给出1,2,3...m
求出
a1,a2,a3,a4,a5,a6,a7的排列共有...
分类:
其他好文 时间:
2014-08-23 03:35:09
阅读次数:
246
最近的CF几乎都没打,感觉挺水的一个题,不过自己仿佛状态不在,看题解才知道做法。输入l,?r,?k (1?≤?l?≤?r?≤?1012;1?≤?k?≤?min(106,?r?-?l?+?1)).从[l,r]选至多k个数使得选出的数的异或值最小,输出最小异或值和方案。分类讨论,首先如果r-l+1=5的...
分类:
其他好文 时间:
2014-08-22 20:58:09
阅读次数:
205
题目链接构造的好题。表示是看了题解才会做的。假如[l,r]长度不超过4,直接暴力就行了。假如[l,r]长度大于等于5,那么如果k = 1,显然答案应该是l;如果k=2,可以找到a^(a+1)=1;如果k=3,首先只取两个就得到一个下界为1,但是可能出现为0的情况,下面再仔细讨论。如果k>=4,可以找...
分类:
其他好文 时间:
2014-08-21 22:30:54
阅读次数:
232
Codeforces Round #262 (Div. 2) 460B. Little Dima and Equation(枚举)...
分类:
其他好文 时间:
2014-08-21 21:15:25
阅读次数:
219
output
standard output
Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his informatics teacher is going to have a birthday and the beaver has decided to prepar...
分类:
其他好文 时间:
2014-08-21 19:31:34
阅读次数:
259
这道题给出了一个犀利的公式x=b·s(x)a+c,
s(x)为求x的各个位数之和,求在0-1000000000之间找到满足这个公式值,明显暴力枚举绝对超时,遍历一边都得一分钟的时间,所以就要分析公式
可以看出s(x)^a=(x-c)/b,也就是说(x-c)/b一定是一个整数,所以循环可以写成for(int i=c;i
的以上思路都是遍历x的值,仔细看公式,里面有一个s(x)^a,说明一个问...
分类:
其他好文 时间:
2014-08-21 11:32:54
阅读次数:
165
Codeforces Round #262 (Div. 2) B. Little Dima and Equation...
分类:
其他好文 时间:
2014-08-21 09:50:03
阅读次数:
163
Going Home
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 17975
Accepted: 9155
Description
On a grid map there are n little men and n houses. In each unit t...
分类:
其他好文 时间:
2014-08-20 21:11:23
阅读次数:
367
Problem DescriptionThere are a bunch of stones on the beach; Stone color is white or black. Little Sheep has a magic brush, she can change the color o...
分类:
其他好文 时间:
2014-08-20 12:11:22
阅读次数:
209
Going HomeTime Limit:1000MSMemory Limit:65536KTotal Submissions:17955Accepted:9145DescriptionOn a grid map there are n little men and n houses. In eac...
分类:
其他好文 时间:
2014-08-20 11:57:03
阅读次数:
370