任意门:http://codeforces.com/contest/1114/problem/C C. Trailing Loves (or L'oeufs?) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The number "zero" is called "love" (or "…
#include<stdio.h> #include<stdlib.h> //快速幂算法,数论二分 long long powermod(int a,int b, int c) //不用longlong就报错,题目中那个取值范围不就在2的31次方内 { long long t; if(b==0) return 1%c; if(b==1) return a%c; t=powermod(a,b/2,c);//递归调用,采用二分递归算法,,注意这里n/2会带来奇偶性问题 t=t*t%c;…