Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
k==0可能么?见内,为什么RE?????Problem Id:3012 User Id:lfj_2 Memory:2684K Time:15MS Language:GCC Result:Runtime Error Source #include<stdio.h> int md,nd,m; gtmd(k){ int t; if(k==1)return 10%m;/////////////////////////改成if(k==0)return 1;就以92K内存ac,whyyyyyyy? t=gtmd(k/2); t=(__int64)t*t%m; if(k%2)t=(__int64)t*10%m; return t; } getnd(n){ int t; if(n==0)return 1; if(n==0)return md; t=getnd(n/2); t=(__int64)t*t%m; if(n%2)t=(__int64)t*md%m; return t; } main(n,k){ for(scanf("%d",&n);~scanf("%d%d%d",&n,&k,&m);printf("%d\n",nd)) md=gtmd(k),md++,md%=m,nd=getnd(n); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator