HDUOJ 2060 Snooker

原创 2012年03月21日 21:41:53

Snooker

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3898    Accepted Submission(s): 1641


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
 

Author
zl
 
#include <iostream>
using namespace std;
int main()
{
	int n,bl,os,ps,flag;
	cin>>n;
	while(n--)
	{
		flag=0;
		cin>>bl>>ps>>os;
		if(ps>=os) flag=1;
		else
		{
			if(bl>=6 && (bl-6)*8+27>=os-ps) flag=1;
			else
			{
				if((15-bl)*bl/2>=os-ps) flag=1;
			}
		}
		printf(flag==1?"Yes\n":"No\n");
	}
	return 0;
}


HDU2060:Snooker

Problem Description background: Philip likes to play the QQ game of Snooker when he wants a relax,...
  • libin56842
  • libin56842
  • 2013年12月28日 17:35
  • 2648

HDOJ2060_Snooker

Problem Description background: Philip likes to play the QQ game of Snooker when he wants a relax,...
  • qq_38238041
  • qq_38238041
  • 2017年10月17日 19:58
  • 59

HDOJ(HDU) 2060 Snooker(英语很重要。。。)

Problem Description background: Philip likes to play the QQ game of Snooker when he wants a relax,...
  • qq_26525215
  • qq_26525215
  • 2016年04月22日 23:38
  • 935

杭电ACM2060java做法(WA)

Snooker Problem Description background: Philip likes to play the QQ game of Snooker when he wan...
  • SuperBeauty
  • SuperBeauty
  • 2015年09月21日 20:08
  • 482

HDOJ(HDU) 2060 Snooker(英语很重要。。。)

Problem Description background: Philip likes to play the QQ game of Snooker when he wants a relax,...
  • qq_26525215
  • qq_26525215
  • 2016年04月22日 23:38
  • 935

【codeforces 13 C】【DP + 离散化 + 贪心+滚动数组 】C. Sequence【用最小代价把序列变成非严格递增序列】

传送门:C. Sequence 描述: C. Sequence time limit per test 1 second memory limit...
  • guhaiteng
  • guhaiteng
  • 2016年10月05日 16:04
  • 259

a simple stone game--k倍动态规划减法游戏

a simple stone game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth...
  • bless924295
  • bless924295
  • 2016年05月10日 18:25
  • 941

HLG 哈理工 1053 Warcraft III (完全背包)

Warcraft III Time Limit: 10000 MS Memory Limit: 65536 K Total Submit: 587...
  • lsgqjh
  • lsgqjh
  • 2015年08月29日 10:20
  • 462

【打CF,学算法——二星级】Codeforces 705B Spider Man (简单博弈)

【CF简介】 题目链接:CF 705B 题面: B. Spider Man time limit per test 2 seconds memo...
  • David_Jett
  • David_Jett
  • 2016年08月08日 09:36
  • 872

Spider Man(cf705B)(水题乱搞)

Spider Man(cf705B)(水题乱搞)
  • Ema1997
  • Ema1997
  • 2016年08月08日 14:53
  • 255
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:HDUOJ 2060 Snooker
举报原因:
原因补充:

(最多只允许输入30个字)