http://acm.fzu.edu.cn/problem.php?pid=2271 [题意] 给定一个n个点和m条边的无向连通图,问最多可以删去多少条边,使得每两个点之间的距离(最短路长度)不变. [思路] 首先对于多重边可以只保留最短的边,剩下的都删去 跑一次Floyd,用vis数组记录哪些边可以被松弛(注意map[i][k]+map[k][j]==map[i][j]时,i-j这条边如果在原图,也可以被删去) 最后遍历一下所有的原图的边,可以被松弛的就可以被删去 [Accepted] #in…
10403: D.山区修路 Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 69  Solved: 23 [Submit][Status][Web Board] Description 某山区的孩子们上学必须经过一条凹凸不平的土路,每当下雨天,孩子们非常艰难.现在村里走出来的Dr. Kong决定募捐资金重新修建着条路.由于资金有限,为了降低成本,对修好后的路面高度只能做到单调上升或单调下降. 为了便于修路,我们将整个土路分成了N段,每段路面的高度分…
10402: C.机器人 Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 53  Solved: 19 [Submit][Status][Web Board] Description Dr. Kong 设计的机器人卡尔非常活泼,既能原地蹦,又能跳远.由于受软硬件设计所限,机器人卡尔只能定点跳远.若机器人站在(X,Y)位置,它可以原地蹦,但只可以在(X,Y),(X,-Y),(-X,Y),(-X,-Y),(Y,X),(Y,-X),(-Y,X),(-Y,…
G.Code the Tree Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 35  Solved: 18 [Submit][Status][Web Board] Description A tree (i.e. a connected graph without cycles) with vertices numbered by the integers 1, 2, ..., n is given. The "Prufer" code…
B.海岛争霸 Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 130  Solved: 48 [Submit][Status][Web Board] Description 神秘的海洋,惊险的探险之路,打捞海底宝藏,激烈的海战,海盗劫富等等.加勒比海盗,你知道吧?杰克船长驾驶着自己的的战船黑珍珠1号要征服各个海岛的海盜,最后成为海盗王. 这是一个由海洋.岛屿和海盗组成的危险世界.杰克船长准备从自己所占领的岛屿A开始征程,逐个去占领每一个岛屿.面对危…
10401: A.物资调度 Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 95  Solved: 54 [Submit][Status][Web Board] Description 某地区发生了地震,灾区已经非常困难,灾民急需一些帐篷.衣物.食品和血浆等物资.可通往灾区的道路到处都是塌方,70%以上的路面损坏,桥梁全部被毁.国家立即启动应急预案,展开史上最大强度非作战空运行动,准备向灾区空投急需物资. 一方有难,八方支援.现在已知有N个地方分别…
10396: H.Rectangles Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 229  Solved: 33 [Submit][Status][Web Board] Description Given N (4 <= N <= 100)  rectangles and the lengths of their sides ( integers in the range 1..1,000), write a program that fi…
10399: F.Turing equation Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 151  Solved: 84 [Submit][Status][Web Board] Description The fight goes on, whether to store  numbers starting with their most significant digit or their least  significant digit…
Description A Swiss-system tournament is a tournament which uses a non-elimination format. The first tournament of this type was a chess tournament in Zurich in 1895, hence the name "Swiss system". The tournament will be held based on following…
Code the Tree Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2350   Accepted: 906 Description A tree (i.e. a connected graph without cycles) with vertices numbered by the integers 1, 2, ..., n is given. The "Prufer" code of such a…