摘要: long exp_mod(long a,long n,long b) //a为底数,n为幂数,b为余数{ long t; if(n==0) return 1%b; if(n==1) return a%b; t=exp_mod(a,n/2,b); t=t*t%b; if((n&1)==1) t=t*a%b; return t;} 阅读全文
posted @ 2014-01-27 16:08 紫忆 阅读(238) 评论(0) 推荐(0) 编辑