原创 B - Tree with Maximum Cost(樹形DP)

You are given a tree consisting exactly of nn vertices. Tree is a connected undirected graph with n−1n−1 edges. Each ve

原创 Z - Simpsons’ Hidden Talents(擴展KMP 模板題)

Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.  Marge: Yeah, what is i

原创 火車車次查詢系統——時間最短,價格最優(非空雙向循環鏈表)C語言Linux實訓作業

huoche.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "huoche.h" #define MAX 10001000 LLIST *p

原创 面向對象程序設計——派生類構造函數

定義基類shape,它有默認的構造函數和析構函數; 把點point類聲明爲shape的派生類,它包含兩個數據成員x和y 和輸出函數display(); 把圓circle定義爲點point類的派生類,它在點point的基礎上增加一個數據成員

原创 根據表達式求出真值表及主析取主合取——離散數學實訓

#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define N 1005 #define ll long long char str

原创 面向對象程序設計——函數重載運算符

定義complex類,它包含兩個雙精度型的數據成員real 和 imag 以及兩個構造函數:一個是無參函數,一個是有參數的函數。 要求:使用類的成員函數 或者友元函數重載運算符+、-、×、÷,使其能夠實現complex類對象的相應運算。

原创 D - Round Numbers(數位dp)

The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Ro

原创 哈夫曼樹——離散數學實訓

#include<stdio.h> #include<stdlib.h> #include<string.h> const int maxn = 1e5 + 5; struct node { int w, pre, l, r;

原创 基礎的學生管理系統——增,刪,查,找(非空雙向循環鏈表)C語言Linux實訓作業

list.c #include<stdio.h> #include<stdlib.h> #include<string.h> #include "llist.h" LLIST *llist_creat(int size) { LLI

原创 基礎的電子詞典——單詞的增刪查找(平衡二叉排序樹) c語言Linux實訓作業

a.c #include <stdlib.h> #include <stdio.h> #include <string.h> #include "a.h" #include "tree.h" FILE *pf; FILE *tf;

原创 js常用項目——小米導航條項目

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=, initial-

原创 js常用項目——輪播圖

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-wid

原创 H - Perfect Ban (模擬)

題目鏈接:https://vjudge.net/problem/Gym-101341H Constantine and Mike are playing the board game «Wrath of Elves». There are

原创 P3379 最近公共祖先(LCA 模板)

題目描述 如題,給定一棵有根多叉樹,請求出指定兩個點直接最近的公共祖先。 輸入格式 第一行包含三個正整數N、M、S,分別表示樹的結點個數、詢問的個數和樹根結點的序號。 接下來N-1行每行包含兩個正整數x、y,表示x結點和y結點之間有一條直

原创 E - How far away ?(lca)

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like