| ||||||||||
| 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 | |||||||||
What's Wrong?#include <stdio.h>
int T, N;
int D[750000]={0,1,2};
int main (){
int i;
for (i=3; i<750000; i++){
D[i]=(D[i-1]*3-D[i-2])%100000;
if (D[i]<0) D[i]+=100000;
}
scanf ( "%d", &T );
for (i=0; i<T; i++){
scanf ( "%d", &N );
N%=750000;
printf ( "%d\n", D[N] );
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator