题解
2025-07-24 11:52:45
发布于:广东
3阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
const int MOD = 10000;
int fff(int n) {
if (n <= 3) {
return 1;
}
int a = 1, b = 1, c = 1;
int re;
for (int i = 4; i <= n; ++i) {
re = (a + b + c) % MOD;
a = b;
b = c;
c = re;
}
return re;
}
int main() {
int n;
cin >> n;
int tmp = fff(n);
cout << tmp << endl;
return 0;
}
这里空空如也
有帮助,赞一个