通过的第一题,留做纪念,呵呵,非常简单,Africa 2010, Qualification Round: Store Credit. #include <stdio.h> #include <stdlib.h> int main(void) { int N,C,I; int *p; int i,j,k; freopen("in.in", "r", stdin); freopen("out", "w",…
第一题:longest 乌托邦有n个城市,某些城市之间有公路连接.任意两个城市都可以通过公路直接或者间接到达,并且任意两个城市之间有且仅有一条路径(What does this imply? A tree!). 每条公路都有自己的长度,这些长度都是已经测量好的. 小修想从一个城市出发开车到另一个城市,并且她希望经过的公路总长度最长.请问她应该选择哪两个城市?这个最长的长度是多少? Input format: 第一行n(n<=1000). 以下n-1行每行三个整数a, b, c.表示城市a和城市b…
Monkey King Time Limit: 10 Seconds Memory Limit: 32768 KB Once in a forest, there lived N aggressive monkeys. At the beginning, they each does things in its own way and none of them knows each other. But monkeys can't avoid quarrelling, and it o…