[POJ 2014] Flow Layout · 模拟
2015-05-21 10:22
267 查看
随便挑的条题目,模拟水题。
(丢代码跑)
(丢代码跑)
#include <stdio.h> #include <iostream> #include <string.h> #include <algorithm> using namespace std; int n,x,y,ansx,ansy,nowx,nowy,nexty; int main(){ cin >> n ; while ( n ) { ansx = ansy = nowx = nowy = nexty = 0 ; cin >> x >> y ; while (x > 0 && y > 0) { if ( x + nowx <= n ) { nowx += x ; ansx = max( ansx , nowx ) ; nexty = max( nowy + y , nexty ) ; } else { nowx = x ; ansx = max( ansx , nowx ) ; nowy = nexty ; nexty = nowy + y ; } cin >> x >> y ; } cout << ansx << " x " << nexty << endl ; cin >> n ; } return 0; }
相关文章推荐
- POJ1094(模拟····拓扑)
- poj 3268 Silver Cow Party(单源最短路径Dijkstra·最小环)
- poj 5001 Walk &&2014 ACM/ICPC Asia Regional Anshan Online 1005(dp)
- POJ 1573 && hdu 1035 Robot Motion(简单模拟)
- [POJ 1804] Brainman · 逆序对
- POJ 3505 && HDU 2341 Tower Parking(简单模拟)
- POJ3087 Shuffle'm Up 简单模拟
- POJ 1573 && hdu 1035 Robot Motion【简单模拟】
- POJ 1118 Lining Up & POJ 2606 Rabbit hunt(模拟)
- ACM: 模拟题 poj 2632 (开始做模拟…
- WebDriver拾级而上·之十五 拖曳动作模拟
- G - Shuffle'm Up POJ 3087 模拟洗牌的过程,算作暴力搜索也不为过
- poj-3087-Shuffle'm Up-模拟
- poj 1103 & zoj 1142 Maze (图形模拟+简单搜索)
- 模拟->YY POJ 2339 Rock, Scissors, Paper
- hdu 1532(poj 1273) Drainage Ditches (网络流·最大流)
- 【POJ】3169 Layout & 【HDU】3592 World Exhibition 差分约束
- Shuffle'm Up (poj 3087 模拟)
- 2014 Unity亚洲开发者大会·中国站:技术课程全面解析
- POJ 1033 / Northeastern Europe 1998 Defragment (模拟&队列)