poj 3672
来源:互联网 发布:ipad弹钢琴软件 编辑:程序博客网 时间:2024/04/30 00:05
[NWPU][2014][TRN][1]水题堆
7:30:00
//@auther Yang Zongjun#include <iostream>#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>#include <string>using namespace std;#define PI acos(-1.0)#define EPS 1e-8const int MAXN = 100005;const int INF = 2100000000;int sum, n, u, f, d;string a[MAXN];int res[MAXN];int main(){// freopen("C:/Users/Administrator/Desktop/input.txt", "r", stdin); cin >> sum >> n >> u >> f >> d; getchar(); for(int i = 0; i < n; i++) { getline(cin, a[i]); //cout << a[i] << endl; } int ans = 0; int t = u + d, cnt = 0; int maxa = min(t, 2*f); for(int i = 0; i < n; i++) { //cout << a[i][0] << endl; //if(sum < ans + maxa) break; if(a[i][0] == 'u' || a[i][0] == 'd') { ans += t;res[cnt++] = ans; } else if(a[i][0] == 'f') { ans += 2*f;res[cnt++] = ans; } } int i; for(i = 0; i < n; i++) { //cout << res[i] << endl; if(res[i] > sum) break; } printf("%d\n", i); return 0;}
0 0
- poj 3672
- POJ 3672(水题)
- POJ 3672 水题......
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- POJ
- POJ
- POJ
- 2014鞍山网络预选赛1004(贪心)hdu5000
- 网络编程中如何设置服务器监听IP
- 类的静态成员数据变量
- java 判断含有中文的字符串的长度
- jquery-mobile的页面跳转和iscroll之间的兼容解决方法
- poj 3672
- cocos2d-x 3.2 |跑酷游戏之 update使用方法
- ListView优化
- Reverse Nodes in k-Group
- 二套二厅二套
- 下载和安装Nginx
- 成果表vfg
- HDU 5001 Walk
- 物理题 三个芭蕾舞演员 等边三角形