题目链接:http://noi.openjudge.cn/ch0206/9271/

同noi 踩方格,但是题目有问题,%12345,我也是看了discuss才知道的。

#include <bits/stdc++.h>
using namespace std;

unsigned long long d[1005];

int main()
{
    d[1] = 3;
    d[2] = 7;
    for(int i=3;i<=1001;i++)
        d[i] = (2*d[i-1] + d[i-2])%12345;

    int n;
    scanf("%d",&n);
    printf("%lld\n",d[n]);
    return 0;
}
View Code

相关文章:

  • 2021-07-23
  • 2021-08-01
  • 2021-10-14
  • 2021-07-05
  • 2021-06-21
  • 2022-01-25
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-09
  • 2021-05-12
相关资源
相似解决方案