#include<stdio.h>
#define N 10007
#define maxn 1000005
int dp[maxn];
int main()
{
    dp[1]=1,dp[2]=2,dp[3]=4;
    for(int i=4;i<maxn;i++)
        dp[i]=dp[i-1]%N+dp[i-2]%N+dp[i-3]%N;
    int n;
    while(scanf("%d",&n)!=EOF)
        printf("%d\n",dp[n]%N);
} 

 

相关文章:

  • 2022-12-23
  • 2022-01-18
  • 2022-01-27
  • 2022-03-05
  • 2021-08-03
  • 2022-12-23
  • 2021-06-28
猜你喜欢
  • 2021-06-05
  • 2021-08-12
  • 2022-02-26
  • 2021-07-12
  • 2022-01-16
  • 2021-12-22
  • 2021-06-20
相关资源
相似解决方案