标签:
题目大意:http://acm.hdu.edu.cn/showproblem.php?pid=2520
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7698 Accepted Submission(s):
4505
1 #include <iostream> 2 #include <cstdio> 3 4 using namespace std; 5 6 int num1[100010],num2[100010]; 7 8 int main() 9 { 10 num1[0]=1; 11 num2[0]=0; 12 for (int i=1; i<100000; i++) 13 { 14 num2[i]=(num1[i-1]+num2[i-1])%10000; 15 num1[i]=num1[i-1]+2; 16 } 17 int t; 18 scanf("%d",&t); 19 while (t--) 20 { 21 int n; 22 scanf("%d",&n); 23 printf ("%d\n",num2[n]); 24 25 } 26 return 0; 27 }
标签:
原文地址:http://www.cnblogs.com/qq-star/p/4623000.html