#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn = 1e4+9;
int s[maxn];
int main()
{
s[1] = 0;
s[2] = 2;
for(int i = 3; i <= 1000; i++)
{
int sum = 1;
for(int j = 1; j <= i-1; j++)
sum = (sum*2)%10000;
if(sum < s[i-1]) sum += 10000;
s[i] = sum-s[i-1];
}
int n;
while(scanf("%d", &n) != EOF && n)
{
printf("%d\n", s[n]);
}
}
hdu 2154 跳舞毯
最新推荐文章于 2020-06-24 13:06:41 发布