Walking Race Description flymouse's sister wc is very capable at sports and her favorite event is walking race. Chasing after the championship in an important competition, she comes to a training center to attend a training course. The center has N…
求树上最长链:两遍搜索. 第一次从树上任意点开始,最远点必然是某一条最长链上的端点u. 第二次从u开始,最远点即该最长链的另一端点. 先在最长链上走,不足再去走支链. 把询问数m错打成n,狠狠wa了一次= = #include<stdio.h> #include<string.h> ; struct E{ int v,next; }e[MAXN<<]; struct Q{ int p,c; }q[MAXN]; int tol; int head[MAXN]; int v…
Computer Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4440 Accepted Submission(s): 2236 Problem Description A school bought the first computer some time ago(so this computer's id is 1). Du…