![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
Radiumm
你的努力还轮不上你拼天赋!
展开
-
Codeforces 551D GukiZ and Binary Operations
D. GukiZ and Binary Operationstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe all know that GukiZ often plays with arrays.Now he is thinking abo...原创 2018-05-07 19:43:33 · 152 阅读 · 0 评论 -
CFGym 101192G. ReHanoi Towers
题意:给了四柱汉诺塔,求将一个柱子上的所有圆盘移到另一个柱子上的最小步数分析:打表找规律。由于n是1e9,肯定不能递归,打表发现结果相邻分别是2,2,4,4,4,8,8,8,8...由于2个2,3个4...x个2^(x-1)。把每一个2的幂看成一组,求第n个数则找到之前有多少完整的组,直接加上,剩下的都相同直接加即可。1+2+...+n = (n+1)*n/2 。复杂度O(根号n)代码:...原创 2018-07-23 21:21:58 · 222 阅读 · 0 评论 -
Codeforces 701D
D. As Fast As Possibletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn vacations n pupils decided to go on excursion and gather all together. The...原创 2018-07-13 11:32:07 · 181 阅读 · 0 评论 -
Codeforces 680C
A. Bear and Prime 100time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is an interactive problem. In the output section below you will see the i...原创 2018-07-13 14:05:51 · 139 阅读 · 0 评论 -
Codeforces 984C. Finite or not?
题意:给了两个数p,q和一个进制数b,问p/q在b进制下是否是有限小数分析:首先对p/q约分,将十进制分数转化为b进制数就是不断乘以b,小数点后依次加上整数部分,如果是有限小数,肯定是最后可以乘到一个数能整除q。但是对于p直接乘以b的话会爆long long 的,这里用到一个trick,就是乘以b最后能整除q的话,其实就看每次乘以b之后会不会产生大于1的b与q的公约数,q的因子就不断被约掉了,...原创 2018-07-31 17:35:31 · 152 阅读 · 0 评论