posts - 100,  comments - 15,  trackbacks - 0
/*
 * 1021.cpp
 *  
 *  Created on: 2010-10-2
 *      Author: wyiu
 
*/

#include 
<cstdio>
#include 
<cstring>
using namespace std;

int f[1000001];

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 x;
    
while(scanf("%d"&x) != EOF)
    {
        
if(f[x] == 0)
            printf(
"yes\n");
        
else printf("no\n");
        fflush(stdout);
    }
    
return 0;
}
posted on 2010-10-02 16:48 wyiu 阅读(212) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理