快速幂
Byte__
ACM成长中。
展开
-
Codeforces Round #295 (Div. 2) C. DNA Alignment
C. DNA Alignment time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya became interested in bioinformatics.原创 2015-03-16 17:09:56 · 134 阅读 · 0 评论 -
HDU 2817 A sequence of numbers 等比OR等差
A sequence of numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3796 Accepted Submission(s): 1164 Problem Description Xinlv wr原创 2015-03-16 22:02:54 · 821 阅读 · 0 评论 -
POJ 3641
Pseudoprime numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7043 Accepted: 2881 Description Fermat's theorem states that for any prime number p a原创 2015-03-16 20:57:23 · 585 阅读 · 0 评论 -
HDU 小明系列故事——师兄帮帮忙 快速幂
小明系列故事——师兄帮帮忙 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 4850 Accepted Submission(s): 1275 Problem Description 小明自从告别了ACM/ICP原创 2015-03-16 21:45:10 · 800 阅读 · 0 评论 -
ZOJ 3690 Choosing number
Choosing number Time Limit: 2 Seconds Memory Limit: 65536 KB There are n people standing in a row. And There are m numbers, 1.2...m. Every one should choose a number. But if two persons s原创 2015-07-08 09:34:51 · 680 阅读 · 0 评论 -
hdu 2276 Kiki & Little Kiki 2矩阵快速幂
Kiki & Little Kiki 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2300 Accepted Submission(s): 1175 Problem Description There原创 2015-08-26 16:29:09 · 644 阅读 · 0 评论 -
HDU 3411 Snail Alice
Snail Alice Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 759 Accepted Submission(s): 193 Problem Description Snail Alice is a原创 2015-08-19 21:11:12 · 727 阅读 · 0 评论 -
UVA 7040 Color 组合数加容斥原理
点击打开链接 题意:告诉n个人排成一排,然后有m种颜色,要给这n个人正好涂k种颜色,相邻两个人颜色要不同,问有多少种方法。 分析:m种颜色选k种,所以有C(m,k),对于选出的k种颜色去给n个人涂色,对于第一个人有k种,第二个人有k-1种,第三个人k-1种。。。。。所以总共是k*(k-1)^(n-1)种。然而不要以为这样就好了,因为这样算并不能保证是一定用了k种颜色的,可能只是选了原创 2015-09-08 23:59:55 · 674 阅读 · 0 评论