杭电2070
来源:互联网 发布:网络与司马是什么意思 编辑:程序博客网 时间:2024/06/07 04:54
/*此题主要注意数组类型注意内存主函数若用递归协会超时,因为for循环过大n平方所以用递推式学习动态规划后只需将动态转移方程写出来即可*/
*/
#include<iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;__int64 a[100];int main(){ int fn1, fn2; __int64 n; while(scanf("%I64d", &n) != EOF && n != -1){ a[0] = 0; a[1] = 1; for(int i = 2; i <= n; i++){ a[i] = a[i - 1] + a[i - 2];//代码主要在这里 推出动态方程即可 } cout << a[n] << endl; } return 0;}
*/
1 0
- 杭电2070
- 杭电2070
- 杭电2070
- 杭电acm 2070
- 杭电acm--2070
- 杭电2070
- Fibbonacci Number(杭电2070)
- 【杭电】[2070]Fibbonacci Number
- 杭电 2070 Fibbonacci Number
- 杭电
- 杭电
- 杭电
- 杭电2070用这个__int64定义,
- 杭电ACM 2070:Fibbonacci Number
- 杭电 1234 和 杭电 2115
- 杭电2056之Rectangles 杭电
- 杭电ACM1061Rightmost Digit
- 杭电2099 7.11
- IOC容器和Bean的配置<03>
- 企业SEO:没必要成为叼着肉的狗
- [编写高质量iOS代码的52个有效方法](十一)系统框架
- 【python】简单实现一个模板引擎
- poj3080Blue Jeans
- 杭电2070
- (博弈)Public SaleHDU2149(巴什博弈)
- 操作系统:死锁 //程序耦合性
- 走向设计(策略模式)
- 设计模式 学习笔记
- opencv中的一般数据类型
- Python字符串
- 提交到app store时,提示ITMS-90478 ,ITMS-90062错误
- pageResult类