D - D

Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Submit Status

Description

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
 

 #include<iostream>
#include<cstdio>
#include<cmath>
#include<ctime>
using namespace std;
int a[];
int main()
{
a[]=;
a[]=;
for(int i=;i<;i++)
{
a[i]=(a[i-]+a[i-])%;
}
int n;
//printf("%.2f",(double)clock()/CLOCKS_PER_SEC);
while((scanf("%d",&n))!=EOF)
{
if(a[n]%==)
{
printf("yes\n");
}
else
{
printf("no\n");
}
}
}

最新文章

  1. Sencha ExtJS 6 Widget Grid 入门
  2. windows和linux中搭建python集成开发环境IDE——如何设置多个python环境
  3. string黑科技
  4. Linux top和负载的说明
  5. beta版本贡献率
  6. 颜色缩减(带Trackbar)【从毛星云Opencv3编程入门P75 P111例程改编】
  7. ExtJs之addManagedListener
  8. centos安装memcache与telnet
  9. Html5 js FileReader接口
  10. linux命令之more
  11. MVC Filter自定义验证(拦截)
  12. Splay tree
  13. BZOJ 1217: [HNOI2003]消防局的设立( 贪心 )
  14. SecureCRT, SecureFX连接Linux时中文乱码解决办法
  15. php中常用的字符串长度函数strlen()与mb_strlen()实例解释
  16. ArcGIS License启动无响应
  17. Struts2笔记_值栈
  18. 依赖注入[4]: 创建一个简易版的DI框架[上篇]
  19. git 环境搭建
  20. Web前端学习第三天(cookie 二)

热门文章

  1. VC:CString用法整理(转载)
  2. FCKeditor 插件开发 示例
  3. [Mugeda HTML5技术教程之19]制作可定制贺卡
  4. 如何让你的 footer 总是在浏览器底部无论什么分辨率无论什么浏览器?
  5. 手机user agent大全下载 整理发布一批移动设备的user agent【分享】
  6. 判断display为隐藏还是显示及获取css
  7. 【笔记】shell下的主要工具
  8. Manasa and Stones
  9. BZOJ 1264 基因匹配Match(LCS转化LIS)
  10. Windows 8.1 Update1 6610 32位/64位下载、安装和新增功能简评