| ||||||||||
| 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 | |||||||||
为什么会超时呢??实在是无解了~~~~#include<stdio.h>
long a[100000];
main()
{
long t;
long i,j,k;
long n;
long a1=1;
long max=2;
a[0]=1;
a[1]=1;
a[2]=2;
for(i=3;i<75000;i++)
{
a1=(a1+a[i-1])%100000;
max=(max+a1)%100000;
a[i]=max;
}
scanf("%ld",&t);
while(t--)
{
scanf("%ld",&n);
k=n%75000;
printf("%ld\n",a[k]);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator