poj3672
来源:互联网 发布:李小龙 泰森 知乎 编辑:程序博客网 时间:2024/05/19 09:50
//poj3672 上山 下山 平地 如何及时返回#include <iostream>using namespace std;int main(){int m, t, u, f, d;cin>>m>>t>>u>>f>>d;char c;int total = 0;int k = 0;for(int i = 0; i < t; i++){cin>>c;if(total <= m){if(c == 'u')total += u + d;else if(c == 'f')total += f * 2;else if(c == 'd')total += d + u;k++;}}cout<<k-1<<endl;return 0;}
0 0
- poj3672
- poj3672
- poj3672
- poj3672
- POJ3672解题报告
- poj3672 Long Distance Racing留念下,惨痛的教训
- poj3325
- js 实现textarea限制输入字数
- 53.Eight (15分待续)
- HTTP 协议详解
- poj3650
- poj3672
- poj3673
- poj3632
- 三道经典的逻辑推理面试题:病狗、三盏灯、买鸡
- unity3d 提高this.transform的效率
- 同一tomcat下不同web项目session共享方法
- HQL: Hibernate查询语言
- poj3619
- [LeetCode] Remove Duplicates from Sorted Array II