快速幂取模
编程高手在此
这个作者很懒,什么都没留下…
展开
-
次方求模
描述 求a的b次方对c取余的值 输入 第一行输入一个整数n表示测试数据的组数(n 每组测试只有一行,其中有三个正整数a,b,c(1= 输出 输出a的b次方对c取余之后的结果 样例输入 3 2 3 5 3 100 10 11 12345 12345 样例输出 3 1 #include int pow_mod(int a,int x,int p) { if(x==0)转载 2014-08-13 10:39:30 · 465 阅读 · 0 评论 -
Quad Tiling
Description Tired 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 · 803 阅读 · 0 评论