提交时间:2023-10-04 09:48:39
运行 ID: 104809
#include<bits/stdc++.h> using namespace std; int main() { int n,*f; cin>>n; f=new int[n+1]; f[1]=1; for(int i=2;i<=n;i++) f[i]=f[i-1]*2+((i+1)%3==0?0:((i+1)%3==1?1:-1)); cout<<f[n]%10000; delete[] f; return 0; }