标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 52548 Accepted Submission(s): 24840
#include <cstdio> using namespace std; const int MAXN=1000005; int f[MAXN]; int main() { f[0]=7%3; f[1]=11%3; for(int i=2;i<1000000;i++) { f[i]=(f[i-1]+f[i-2])%3; } int n; while(scanf("%d",&n)!=EOF) { if(f[n]==0) { printf("yes\n"); } else { printf("no\n"); } } return 0; }
标签:
原文地址:http://www.cnblogs.com/program-ccc/p/5700759.html