hdoj-2060-Snooker
来源:互联网 发布:php 数组移除指定元素 编辑:程序博客网 时间:2024/06/05 18:45
Problem Description
background:
Philip likes to play the QQ game of Snooker when he wants a relax, though he was just a little vegetable-bird. Maybe you hadn’t played that game yet, no matter, I’ll introduce the rule for you first.
There are 21 object balls on board, including 15 red balls and 6 color balls: yellow, green, brown, blue, pink, black.
The player should use a white main ball to make the object balls roll into the hole, the sum of the ball’s fixed value he made in the hole is the player’s score. The player should firstly made a red ball into the hole, after that he gains red-ball’s value(1 points), then he gets the chance to make a color ball, then alternately. The color ball should be took out until all the red-ball are in the hole. In other word, if there are only color balls left on board, the player should hit the object balls in this order: yellow(2 point), green(3 point), brown(4 point), blue(5 point), pink(6 point), black(7 point), after the ball being hit into the hole, they are not get out of the hole, after no ball left on board, the game ends, the player who has
the higher score wins the game. PS: red object balls never get out of the hole.
I just illustrate the rules that maybe used, if you want to contact more details, visit http://sports.tom.com/snooker/ after
the contest.
for example, if there are 12 red balls on board(if there are still red ball left on board, it can be sure that all the color
balls must be on board either). So suppose Philp can continuesly hit the ball into the hole, he can get the maximun score is
12 * 1 (12 red-ball in one shoot) + 7 * 12(after hit a red ball, a black ball which was the most valuable ball should be the target) + 2 + 3 + 4 + 5 + 6 + 7(when no red ball left, make all the color ball in hole).
Now, your task is to judge whether Philip should make the decision to give up when telling you the condition on board(How many object balls still left not in the hole and the other player’s score). If Philp still gets the chance to win, just print “Yes”, otherwise print “No”. (PS: if the max score he could get on board add his current score is equal to the opponent’s current score, still output “Yes”)
Input
The first line contains a numble N indicating the total conditions. Then followed by N lines, each line is made of three integers:
Ball_Left P_Score O_Score represeting the ball number left on board, Philp’s current score, and the opponent’s current score.
All the input value are in 32 bit integer value range.
Output
You should caculate the max score left Philp can gain, and judge whether he has the possiblity to win.
Sample Input
2
12 1 1
1 30 39
Sample Output
Yes
No
就是一个算积分的问题,题目看清楚了就直接暴力开干
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int a,b,c; int score=0; scanf("%d%d%d",&a,&b,&c); if(a>6) { score=(a-6)*1+(a-6)*7+27; if(b+score>=c) printf("Yes\n"); else printf("No\n"); } else if(a==6) { if(b+27>=c) printf("Yes\n"); else printf("No\n"); } else if(a==5) { if(b+25>=c) printf("Yes\n"); else printf("No\n"); } else if(a==4) { if(b+22>=c) printf("Yes\n"); else printf("No\n"); } else if(a==3) { if(b+18>=c) printf("Yes\n"); else printf("No\n"); } else if(a==2) { if(b+13>=c) printf("Yes\n"); else printf("No\n"); } else if(a==1) { if(b+7>=c) printf("Yes\n"); else printf("No\n"); } else { if(b>=c) printf("Yes\n"); else printf("No\n"); } } return 0;}
- HDOJ 2060 Snooker
- hdoj 2060 Snooker 【水】
- hdoj-2060-Snooker
- hdoj Snooker 2060 (水)
- HDOJ 2060 Snooker(考翻译)
- HDOJ(HDU) 2060 Snooker(英语很重要。。。)
- Snooker 2060
- HDUOJ 2060 Snooker
- hdu 2060Snooker
- hdu 2060 snooker
- 【水题】hdu 2060 Snooker
- hdu 2060 Snooker
- HDU 2060 Snooker
- HDU 2060 Snooker
- Snooker(2060)
- 2060Snooker斯诺克
- HDU—— 2060 Snooker
- hdu 2060 Snooker(数学题)
- J - HDD is Outdated Technology
- 学习笔记(一)C#基础和泛型List和DataTable和HashTable和Dictionary的简单用法--存值 取值
- 【CodeForces】 612A - The Text Splitting
- spark在linux下开发使用程序包下载 tgz
- Sample rate 理解
- hdoj-2060-Snooker
- RHEL6上使用start_udev命令导致网卡down掉
- 你必须了解的Session的本质
- K - Spongebob and Joke
- linux 新建一个管理员用户admin,需要使用的参数()
- Java操作Mongodb(转载)
- angular的http三种请求方式
- Codeforces Round #304 (Div. 2) D 线性筛
- 牛逼哄哄的SLAM技术 即将颠覆哪些领域?