poj1953
来源:互联网 发布:什么是面向对象的编程 编辑:程序博客网 时间:2024/06/07 09:17
费布纳西数列;最后一位是0,那前面的就可以是f(n-1)种情况,最后一位是1,前面一位必是0,再前面也可以是f(n-2)种情况,所以f(n)=f(n-1)+f(n-2)
#include <cstdio>int main(){int n;while(scanf("%d",&n)){if(n==-1){break;}int s;int t;int med=0;int dis=0; while(n--){ scanf("%d%d",&s,&t); dis =dis + s*(t-med); med=t; } printf("%d miles\n",dis); }}
- poj1953
- poj1953
- poj1953
- POJ1953
- POJ1953
- POJ1953
- poj1953
- Poj1953 WorldCupNoise
- POJ1953 World Cup Noise
- poj1953 简单DP
- POJ1953 World Cup Noise
- (POJ1953)World Cup Noise
- poj1953 排列组合(插空法)
- POJ1953 World Cup Noise DP水题
- poj1953(找规律——斐波拉契数列)
- (POJ1953)World Cup Noise(dp)
- POJ1953菲波那切数列
- 【POJ1953】World Cup Noise(动态规划,斐波那契数列)
- Response.Redirect和Server.Transfer 的区别
- vb.net中的public,private,shared关键字
- poj1316
- poj2017
- C# 数值转换相关
- poj1953
- 程序员技术练级攻略
- poj1401
- 指向数组的指针,指向函数的指针
- Dijkstra算法探索及优化
- c#频繁读取word文件 所请求的剪切板操作失败 解决方法
- PowerShell 学习笔记-- 2 -- 杂项设置
- Eclipse 常用快捷键
- App hub功能改进详解