摘要: Red and BlackTime Limit:1000MSMemory Limit:30000KTotal Submissions:20512Accepted:10986DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can' 阅读全文
posted @ 2014-02-19 21:34 偶尔会寂寞 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 算法提高 最小方差生成树 时间限制:1.0s 内存限制:256.0MB问题描述给定带权无向图,求出一颗方差最小的生成树。输入格式输入多组测试数据。第一行为N,M,依次是点数和边数。接下来M行,每行三个整数U,V,W,代表连接U,V的边,和权值W。保证图连通。n=m=0标志着测试文件的结束。输出格式对于每组数据,输出最小方差,四舍五入到0.01。输出格式按照样例。样例输入4 51 2 12 3 23 4 24 1 12 4 34 61 2 12 3 23 4 34 1 12 4 31 3 30 0样例输出Case 1: 0.22Case 2: 0.00数据规模与约定1#include#incl. 阅读全文
posted @ 2014-02-19 16:55 偶尔会寂寞 阅读(365) 评论(0) 推荐(0) 编辑
摘要: Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22702 Accepted Submission(s): 10108Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the ... 阅读全文
posted @ 2014-02-19 08:10 偶尔会寂寞 阅读(204) 评论(0) 推荐(0) 编辑