题目:http://codeforces.com/gym/100338/attachments贪心,每次枚举10的i次幂,除k后取余数r在用k-r补在10的幂上作为候选答案。#includeusing namespace std;typedef unsigned long long ull;cons...
分类:
其他好文 时间:
2015-08-21 19:26:23
阅读次数:
245
递推就好了,用二项式定理算出所有连边的方案数,减去不合法的方案,每次选出一个孤立点,那么对应方案数就是上次的答案。枚举选几个孤立点和选哪些,选到n-1个点的时候相当于都不选,只减1。要用到高精度,直接开100*100的组合数数组会MLE,用滚动数组优化一下就好了。不会java,python太伤了#i...
分类:
其他好文 时间:
2015-08-21 19:02:50
阅读次数:
208
正反两次最短路用于判断边是不是最短路上的边,把最短路径上的边取出来。然后求割边。#includeusing namespace std;typedef long long ll;#define fi first#define se second#define bug(x) coutdfn[u]) {...
分类:
其他好文 时间:
2015-08-21 18:58:29
阅读次数:
137
J. Deck ShufflingTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100187/problem/JDescriptionThe world famous scientist Innokentiy ...
分类:
其他好文 时间:
2015-08-21 13:15:19
阅读次数:
179
题目连接http://codeforces.com/gym/100463/attachmentsDescriptionRichard is evil. He wants to give another geometry problem to the participants of this cont...
分类:
其他好文 时间:
2015-08-21 11:09:11
阅读次数:
153
题意:给定一个n,求区间[1, n]之间的所有的a的个数,a满足:
a能整除 把a表示自身二进制以后1的个数
思路:题意很绕....
数位dp,对于所有可能的1的个数我们都dfs一次
对于某一个可能的1的个数p来说,状态dp(len, i, j, k)里的每一位分别表示当前位,当前确定位的值模除p,已经有了多少个1,是否已经小于给定的n,
注意的是这题范围很大,要用unsigned l...
分类:
其他好文 时间:
2015-08-20 06:48:38
阅读次数:
102
Problem C. ICPC GiveawaysTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100500/attachmentsDescriptionDuring the preparation for t...
分类:
其他好文 时间:
2015-08-19 13:00:38
阅读次数:
346
M. Variable ShadowingTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100513/problem/MDescriptionIn computer programming,variable s...
Problem E: Reliable NetsYou’re in charge of designing a campus network between buildings and are very worried about itsreliability and its cost. So, y...
分类:
Web程序 时间:
2015-08-19 01:52:56
阅读次数:
465
Problem H: Two EndsIn the two-player game “Two Ends”, an even number of cards is laid out in a row. On each card, faceup, is written a positive intege...
分类:
其他好文 时间:
2015-08-18 21:11:14
阅读次数:
177