There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).

Input

Input consists of a sequence of lines, each containing an integer n. (n < 1,000,000).

Output

Print the word "yes" if 3 divide evenly into F(n). 

Print the word "no" if not.

Sample Input

0
1
2
3
4
5

Sample Output

no
no
yes
no
no
no

前三十中被三整除的数

可以清楚的看到n%4==2,即规律。

代码:

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream> using namespace std;
int a[104];
int main()
{
int n;
while(cin>>n)
{
if(n%4==2)
{
cout<<"yes"<<endl;
}
else
{
cout<<"no"<<endl;
}
} return 0;
}

HDU-Fibonacci Again(打表找规律)的更多相关文章

  1. HDU 3032 multi-sg 打表找规律

    普通NIM规则加上一条可以分解为两堆,标准的Multi-SG游戏 一般Multi-SG就是根据拓扑图计算SG函数,这题打表后还能发现规律 sg(1)=1 sg(2)=2 sg(3)=mex{0,1,2 ...

  2. HDU 5976 Detachment 打表找规律

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5976 Detachment Time Limit: 4000/2000 MS (Java/Other ...

  3. hdu 3032 sg打表找规律 *

    有n堆石子,alice先取,每次可以选择拿走一堆石子中的1~x(该堆石子总数) ,也可以选择将这堆石子分成任意的两堆.alice与bob轮流取,取走最后一个石子的人胜利. 打表代码: #include ...

  4. HDU 1021 Fibonacci Again【打表找规律】

    Fibonacci Again Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  5. hdu 3032 Nim or not Nim? (SG函数博弈+打表找规律)

    Nim or not Nim? Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Sub ...

  6. HDU 5753 Permutation Bo (推导 or 打表找规律)

    Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...

  7. HDU 5795 A Simple Nim(SG打表找规律)

    SG打表找规律 HDU 5795 题目连接 #include<iostream> #include<cstdio> #include<cmath> #include ...

  8. HDU 4731 Minimum palindrome 打表找规律

    http://acm.hdu.edu.cn/showproblem.php?pid=4731 就做了两道...也就这题还能发博客了...虽然也是水题 先暴力DFS打表找规律...发现4个一组循环节.. ...

  9. Codeforces 193E - Fibonacci Number(打表找规律+乱搞)

    Codeforces 题目传送门 & 洛谷题目传送门 蠢蠢的我竟然第一眼想套通项公式?然鹅显然 \(5\) 在 \(\bmod 10^{13}\) 意义下并没有二次剩余--我真是活回去了... ...

  10. HDU 4861 Couple doubi (数论 or 打表找规律)

    Couple doubi 题目链接: http://acm.hust.edu.cn/vjudge/contest/121334#problem/D Description DouBiXp has a ...

随机推荐

  1. C#正则表达式匹配双引号

    html: <img class="bubble large" src="/images/hero-logos/cog.svg" width=" ...

  2. 卸载phonegap

    npm uninstall cordova  -gnpm uninstall phonegap -g

  3. Selenium二次封装-Java版本

    package com.yanfuchang.selenium.utils; import java.awt.AWTException; import java.awt.Robot; import j ...

  4. tomcat8.0的下载安装配置

    配置tomcat前要先配置JDK的环境变量 具体方法请点链接JDK环境变量配置 首先要 到官网下载tomcat tomcat官网 进入官网后 如图在左侧选择自己想要下载的版本,这里我以8.0版本为例 ...

  5. R: 正则表达式

    正则表达式: 例:sub("a","",c("abcd","dcba")):   [1] "bcd" ...

  6. Luogu 2824 [HEOI2016/TJOI2016]排序

    BZOJ 4552 挺妙的解法. 听说这题直接用一个桶能拿到$80 \ pts$ 发现如果是一个排列的话,要对这个序列排序并不好做,但是假如是$01$序列的话,要对一个区间排序还是很简单的. 发现最后 ...

  7. Ubuntu 切换到桌面 快捷键设置

    设置完以上步骤后,这接windows系统键+d,即可切换到桌面. ps:按Alt+Tab键,可以切换到自己想要的图标进程.

  8. WPF之MVVM模式(2)

    我们都想追求完美 Every view in the app has an empty codebehind file, except for the standard boilerplate cod ...

  9. 从底层了解ASP.NET体系结构

    导读:  前言  关于ASP.NET的底层的工作机制,最近园子里讨论的甚是火热.相信很多人都看过Rick Strahl先生的一篇经典之作:A low-level Look at the ASP.NET ...

  10. git CVE-2014-9390 验证以及源码对比

    一 验证部分 首先在ubuntu下面建立如下工程 mkdir repo cd repo git init mkdir -p .GiT/hooks cp post-checkout .GiT/hooks ...