快速幂取模
编程高手在此
这个作者很懒,什么都没留下…
展开
-
次方求模
描述求a的b次方对c取余的值输入第一行输入一个整数n表示测试数据的组数(n每组测试只有一行,其中有三个正整数a,b,c(1=输出输出a的b次方对c取余之后的结果样例输入32 3 53 100 1011 12345 12345样例输出31#includeint pow_mod(int a,int x,int p){ if(x==0)转载 2014-08-13 10:39:30 · 465 阅读 · 0 评论 -
Quad Tiling
DescriptionTired of the Tri Tiling game finally, Michael turns to a more challengeable game, Quad Tiling:In how many ways can you tile a 4 × N (1 ≤ N ≤ 109) rectangle with 2 × 1 dominoes? For th转载 2014-12-07 16:04:29 · 804 阅读 · 0 评论