标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 50863 Accepted Submission(s): 24079
#include<iostream> #include<cstdio> using namespace std; #define LL long long int f[1000005]; int main() { f[0]=1; f[1]=2; int t=2; while(t<1000005) { f[t]=(f[t-1]+f[t-2])%3; t++; } int n; while(scanf("%d",&n)!=EOF) { if(f[n]==0) printf("yes\n"); else printf("no\n"); } return 0; }
标签:
原文地址:http://www.cnblogs.com/jasonlixuetao/p/5452479.html