hdu1021Fibonacci Again找规律
2015-08-14 09:02
453 查看
Problem 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.
私以为找规律比构造矩阵好写==
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.
私以为找规律比构造矩阵好写==
#include <iostream> #include <stdio.h> #include <math.h> #define Mod 3 using namespace std; int main() { int n; while(~scanf("%d",&n)) { if(n%8==2||n%8==6) puts("yes"); else puts("no"); } return 0; }
相关文章推荐
- PS和AI软件区别
- HDU - 3394 Railway(连通分量+环)
- qmail 相关问题
- 智能改变未来TurboMail邮件系统招商新计划
- UVA 10986 Sending email 【dijkstra + 堆优化】
- POJ 1363 Rails
- 如何利用OpenCV自带的haar training程序训练分类器
- 使用OGG的logdump工具检查OGG trail file中存在不存在相关表的记录
- pair的用法
- hdu 1702 ACboy needs your help again!
- tail -f 退出不了怎么办
- HDU 1022 Train Problem I
- [CareerCup] 5.4 Explain Expression ((n & (n-1)) == 0) 解释表达式
- 2015 Multi-University Training Contest 8 hdu 5389 Zero Escape
- HDU 4720 Naive and Silly Muggles
- 1090. Highest Price in Supply Chain (25)
- hdu 1022 Train Problem I
- The 11-th Programming Contest of Hunan University -- Trailing Zeros of Factorials
- 重绘(repaints) 重排(reflows)
- 2015 HUAS Summer Trainning #5~N