标签:
1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<ctime> 5 using namespace std; 6 int a[1000010]; 7 int main() 8 { 9 a[0]=7; 10 a[1]=11; 11 for(int i=2;i<1000000;i++) 12 { 13 a[i]=(a[i-1]+a[i-2])%3; 14 } 15 int n; 16 //printf("%.2f",(double)clock()/CLOCKS_PER_SEC); 17 while((scanf("%d",&n))!=EOF) 18 { 19 if(a[n]%3==0) 20 { 21 printf("yes\n"); 22 } 23 else 24 { 25 printf("no\n"); 26 } 27 } 28 }
标签:
原文地址:http://www.cnblogs.com/guofeng1022/p/4246343.html