POJ 3672(水题)
来源:互联网 发布:maya软件好学吗 编辑:程序博客网 时间:2024/05/17 07:38
点击打开链接
#include<cstdio>#include<cstring>#include<algorithm>#include<iostream>#include<map>#include<vector>#include<cmath>using namespace std;typedef long long ll;const int maxn = 100000 + 5;int main(){ map<char, int> mp; int M,T,U,F,D; int a[maxn]; while(~scanf("%d%d%d%d%d",&M,&T,&U,&F,&D)) { memset(a, 0, sizeof(a)); mp['u'] = U; mp['f'] = F; mp['d'] = D; char ch; int sum = 0; int ans = 0; for(int i = 0; i < T; i++) { cin >> ch; if(sum <= M) { sum += mp[ch]; if(ch == 'f') sum += mp['f']; if(ch == 'u') sum += mp['d']; if(ch == 'd') sum += mp['u']; if(sum <= M) ans++; } //a[i] = mp[ch]; //cout << a[i] << endl; } printf("%d\n",ans); } return 0;}
0 0
- POJ 3672(水题)
- POJ 3672 水题......
- poj 3672
- poj水题
- POJ 水题
- POJ 水题
- poj水题
- poj 水题
- poj 水题
- POJ水题
- poj水题
- poj 水题
- POJ水题
- POJ水题
- poj 3672 Long Distance Racing(水题)
- [poj] 水题2159
- POJ 2665 水题
- POJ 3094 Quicksum 水题
- next_permutation函数 自动排序
- MySql安装 版本 mysql-5.7.14-winx64
- C++处理字符串的方法——字符串类与字符串变量
- unity3d KeyCode各键值说明
- Java Web学习(35):Filter学习(二)
- POJ 3672(水题)
- Codeforces Round #304 (Div. 2)D. Soldier and Number Game
- Error:No suitable device found: no device found for connection "System eth0"
- !!!
- threading的应用以及join、setDaemon的分析
- 2013长春现场赛 (hdu4819)Mosaic
- PL/SQL:结构、语句块、变量
- 数据结构里的串是什么东西?(其实串就是指字符串)
- 【NOIP2012模拟11.5】小A 的作业