HDU 1021 Fibonacci Again
2015-07-30 14:17
513 查看
题目
Fibonacci Again分析
给出一斐波那契数列f(n)f(n),给出nn,问3是否能整除f(n)f(n)。思路
递归求f(n)f(n)->Runtime Error(ACCESS_VIOLATION);
初始化f[n]f
->
Wrong Answer(又溢出啦);
找规律!
7 no
11 no
18 yes
29 no
47 no
76 no
123 yes
199 no
322 no
521 no
843 yes
……
代码
#include <cstdio> int main() { int n; while (~scanf("%d", &n)) if (n % 4 == 2) printf("yes\n"); else printf("no\n"); return 0; }
相关文章推荐
- ubuntu sendmail 发送邮件
- 象棋AI算法(二)
- main真正的形状函数
- SVN commit:remains in tree-conflict错误的解决办法
- details
- Handler sendMessage 与 obtainMessage (sendToTarget)比较
- 有关人工智能的假设
- HDU 1022 Train Problem I
- UVALive 6800 The Mountain of Gold (bellman_ford判负环)
- uva 11374 Airport Express(最短路)
- DataBinder.Eval和Container.DataItem(DataRowView)有什么区别
- Open-air shopping malls(二分半径,两元交面积)
- 基于CLM(Constrained local model)人脸点检测算法
- Easy 2048 Again - ZOJ 3802 像缩进dp
- 怎么提高RailS应用的性能
- Rails项目中避免滥用这三种特性
- hdu 5319 Painter(杭电多校赛第三场)
- use sleep() to gain thread predictability
- HUAS Summer Trainning #3~B
- mongodb3.0.4 MongoDB-CR Authentication failed