a272.
猥瑣罐頭下樓梯
| From: [58.115.238.56] |
發表日期
:
2015-07-09 14:03
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
long long int a[1000][200];
long long int x, s;
while(cin>>x){
a[0][1]=1; a[0][2]=2;
for(int i=0; i<x; i++){
for(s=2; s+i*1000<x; s++){
a[i][s+1]=a[i][s]+a[i][s-1];
a[i][s+1]=a[i][s+1]%10007;
}
}
cout<<a[x/200][x%200]%10007<<endl;
}
return 0;
}