标签:des blog io ar java strong for 数据 sp
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 37229 Accepted Submission(s):
17970
#include <stdio.h> #include <string.h> #include <stdlib.h> int f[1000001]; int main() { int n; int i, j; f[0]=7%3 ; f[1]=11%3 ; for(i=2; i<1000000; i++) { f[i]=(f[i-1]%3+f[i-2]%3)%3; } while(scanf("%d", &n)!=EOF) { if(f[n]==0) printf("yes\n"); else printf("no\n"); } return 0; }
标签:des blog io ar java strong for 数据 sp
原文地址:http://www.cnblogs.com/yspworld/p/3997010.html