1453: [藍橋杯2019初賽]數列求值
阿新 • • 發佈:2021-01-25
2019省賽A組第2題 數列求值
題目連結http://oj.ecustacm.cn/problem.php?id=1453
答案:4659
#include<iostream>
using namespace std;
long long a[20190325] = { 1,1,1 };
int main() {
for (int i = 3; i < 20190324; i++) {
a[i] = (a[i - 1] % 10000 + a[i - 2] % 10000 + a[i - 3] % 10000)%10000;
}
printf("%lld", a[ 20190323]);
return 0;
}