bnuoj 4207 台风(模拟题)
2013-10-10 19:30
232 查看
http://www.bnuoj.com/bnuoj/problem_show.php?pid=4207
【题意】:中文题,略
【题解】:模拟
【code】:
【题意】:中文题,略
【题解】:模拟
【code】:
#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; struct Nod { int t,sh; }node[3][10]; void init() { //XsugarX node[0][0].t = 15; node[0][0].sh = 650; node[0][1].t = 19; node[0][1].sh = 450; node[0][2].t = 46; node[0][2].sh = 1100; //temperlsyer node[1][0].t = 9; node[1][0].sh = 200; node[1][1].t = 9; node[1][1].sh = 200; node[1][2].t = 10; node[1][2].sh = 400; node[1][3].t = 10; node[1][3].sh = 500; node[1][4].t = 45; node[1][4].sh = 850; } int main() { int t; init(); scanf("%d",&t); while(t--) { int time,p1,p2; scanf("%d%d%d",&time,&p1,&p2); int i,atk[3]={0}; int next0=node[0][0].t,next1=node[1][0].t; int add0=0,add1=0,cnt0=0,cnt1=0; for(i=0;i<=time;i++) { int flag0=0,flag1=0; if(next0==i) { p2-=node[0][cnt0].sh; cnt0=(cnt0+1)%3; flag0=1; } if(next1==i) { p1-=node[1][cnt1].sh; cnt1=(cnt1+1)%5; flag1=1; } if(flag0) { next1+=2; next0+=node[0][cnt0].t; } if(flag1) { next1+=node[1][cnt1].t; next0+=2; } if(flag0||flag1) { if(p1<=0||p2<=0) { break; } } } if((p1<=0&&p2<=0)||(p1==p2)) { puts("DRAW"); } else if(p1>p2) { printf("XsugarX %d\n",p1); } else if(p1<p2) { printf("temperlsyer %d\n",p2); } } return 0; }
相关文章推荐
- bnuoj 33648 Neurotic Network(树形模拟题)
- 今晚台风吹袭本市。
- 台风 Vs 沙尘
- 软件测试考试模拟题
- pku3475--Paper-, er, Transcript-Folding Game简单模拟题
- 希赛2009年网工模拟题9
- BNUOJ 4112 奶牛大集会 ---- 树的优美
- 广东凡亚比台风受灾地区未出现传染病疫情
- 汇编语言程序设计模拟题
- 开玩笑的台风
- POJ 1862 变形虫合成 模拟题 优先权队列
- 模拟题7
- 企业网模拟题求指导。
- Building Foundation 模拟题
- POJ 1008 Maya Calendar 模拟题
- HDU 4431 Mahjong 2012天津A题 模拟题
- UVA 573 Steps 简单模拟题
- OCJP(1Z0-851) 模拟题分析(三)
- 雷军投资“style”:不熟不投 找准“台风口”
- 2012年蓝桥杯C本科(第9题夺冠概率)模拟题