随笔分类 -  ACM

摘要:这题先求出最小生成树,然后在最小生成树中求任意两个点之和的平均数。。因为最小生成树是唯一的,所以期望也就只有一个。求最小生成树的时候把树存起来。求任意两点之和的时候我们求出一条边在求和的时候用了多少次,也就是求该边的左右端点有多少个比如一条边左右两边有A,B个端点,那... 阅读全文
posted @ 2016-07-20 20:47 __NaCl 阅读(109) 评论(0) 推荐(0)
摘要:给出一个只有01的字符串,请找出最长的的01的数目的相等的字串。。这题最暴力的解决方法就是就是先预处理每个区间01的数目,然后枚举起点和重点,时间复杂度是O(N^2)。下面我们来介绍一种O(n)时间复杂度的做法。。。首先我们可以用一个数组B[i]把串A当中A[0...... 阅读全文
posted @ 2015-12-31 09:05 __NaCl 阅读(152) 评论(0) 推荐(0)
摘要:对于背包问题,网上有很多博客= =,如果有不小心点进来的朋友,看到我挫逼的博文然后看不懂,可以自行百度一篇,其中本文的博文内 容参照 http://blog.csdn.net/lyhvoyage/article/details/8545852#0-qzone-1-46... 阅读全文
posted @ 2015-08-03 20:58 __NaCl 阅读(98) 评论(0) 推荐(0)
摘要:Cent Savings Time Limit: 5000ms, Special Time Limit:12500ms, Memory Limit:65536KB Total submit users: 59, Accepted users: 45 Problem 1... 阅读全文
posted @ 2015-08-03 14:32 __NaCl 阅读(97) 评论(0) 推荐(0)
摘要:Judging Troubles Time Limit: 5000ms, Special Time Limit:12500ms, Memory Limit:65536KB Total submit users: 91, Accepted users: 72 Probl... 阅读全文
posted @ 2015-08-03 14:27 __NaCl 阅读(95) 评论(0) 推荐(0)
摘要:Joke with permutation Time Limit: 3000ms, Special Time Limit:7500ms, Memory Limit:65536KB Total submit users: 87, Accepted users: 60 P... 阅读全文
posted @ 2015-08-03 14:10 __NaCl 阅读(206) 评论(0) 推荐(0)
摘要:题目链接http://acm.hnu.cn/online/?action=problem&type=show&id=13342&courseid=0 Problem description The races became more popular than ever... 阅读全文
posted @ 2015-08-03 13:36 __NaCl 阅读(138) 评论(0) 推荐(0)
摘要:Problem DescriptionThere are n apple trees planted along a cyclic road, which is L metres long. Your storehouse is built at position 0... 阅读全文
posted @ 2015-07-24 17:03 __NaCl 阅读(172) 评论(0) 推荐(0)
摘要:Your current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the fl... 阅读全文
posted @ 2015-07-23 22:09 __NaCl 阅读(124) 评论(0) 推荐(0)