http://ybt.ssoier.cn:8088/problem_show.php?pid=1188


#include<iostream>
using namespace std;
const int maxn=1000000;
const int mod=1000;
int f[maxn+1];


void init()
{
     f[1]=f[2]=1;
     for(int i=3;i<=maxn;i++)
     {
         f[i]=(f[i-1] + f[i-2])%mod;
     }   
}


int main()
{
     init();
     int n;
     cin>>n;
     while(n--)
     {
         int x;
         cin>>x;
         cout<<f[x]<<endl;
     }

    return 0;
}

相关文章:

  • 2022-12-23
  • 2022-01-13
  • 2021-08-05
  • 2021-10-23
  • 2022-01-09
  • 2021-10-28
  • 2021-04-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案