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 // WA了3次。。。
// notice that
// "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"
// "if the max score he could get on board add his current score is equal to the opponent's current score, still output "Yes""
 #include<stdio.h>
#define COLOR 27
int main()
{
int n, left, score, opp, re;
scanf("%d", &n);
while(n--)
{
scanf("%d %d %d", &left, &score, &opp);
if(left<=) re=*left-left*(left-)/;
else re=left-+*(left-)+COLOR;
if(score+re>=opp) printf("Yes\n");
else printf("No\n");
}
return ;
}

AC

3P - Snooker的更多相关文章

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

    Problem Description background: Philip likes to play the QQ game of Snooker when he wants a relax, t ...

  2. 斯诺克台球比赛规则 (Snooker)

    斯诺克台球比赛规则 斯诺克(Snooker)的意思是“阻碍.障碍”,所以斯诺克台球有时也被称为障碍台球.此项运动使用的球桌长约3569毫米.宽1778毫米,台面四角以及两长边中心位置各有一个球洞,使用 ...

  3. soj1047.Super Snooker(转换思路+二路求和)

    Description On one of my many interplanetary travels I landed on a beautiful little planet called Cr ...

  4. 3p

    哈,不要自卑.爱情和婚姻可遇不可求,缘到自然成.首要的是人好,容貌別太差,毕竟天天在一起看着要舒心才好,另外应该有上进心,避免势利小人.这些,都要看机缘.所谓right person at right ...

  5. CentOS6.x服务器OpenSSH平滑7.3p版本——拒绝服务器漏洞攻击

    对于新安装的Linux服务器,默认OpenSSH及OpenSSL都不是最新的,需要进行升级以拒绝服务器漏洞攻击.本次介绍的是升级生产环境下CentOS6.x系列服务器平滑升级OpenSSL及OpenS ...

  6. CentOS6.x服务器OpenSSH平滑升级到7.3p版本——拒绝服务器漏洞攻击

    对于新安装的Linux服务器,默认OpenSSH及OpenSSL都不是最新的,需要进行升级以拒绝服务器漏洞攻击.本次介绍的是升级生产环境下CentOS6.x系列服务器平滑升级OpenSSL及OpenS ...

  7. 如何在ASP.Net创建各种3D图表

    我们都知道,图表在ASP.NET技术中是一种特别受欢迎而又很重要的工具.图表是表示数据的图形,一般含有X和Y两个坐标轴.我们可以用折线,柱状,块状来表示数据.通过图表控件,我们即能表示数据又能比较各种 ...

  8. Nginx反向代理,负载均衡,redis session共享,keepalived高可用

    相关知识自行搜索,直接上干货... 使用的资源: nginx主服务器一台,nginx备服务器一台,使用keepalived进行宕机切换. tomcat服务器两台,由nginx进行反向代理和负载均衡,此 ...

  9. Android—关于自定义对话框的工具类

    开发中有很多地方会用到自定义对话框,为了避免不必要的城府代码,在此总结出一个工具类. 弹出对话框的地方很多,但是都大同小异,不同无非就是提示内容或者图片不同,下面这个类是将提示内容和图片放到了自定义函 ...

随机推荐

  1. 打印 laravel 模型查询产品的 SQL

    1.在路由閉包打印sql 打印一段代码生产的 sql 语句,使用路由闭包做个实验 Route::get('/get-sql', function() { DB::enableQueryLog(); $ ...

  2. nginx+keeplived+tomcat

    1,宣告操作系统版本,nginx,java,tomcat,keeplived版本 操作系统 用途 VIP IP地址 软件版本 CentOS 7.3 mini NTP服务器 无 192.168.197. ...

  3. vs2012 函数参数内存对齐引发编译错误

    编译一个游戏库时,遇到个奇怪的问题.一个模板函数,形参是按值传入的.编译时实参是内存对齐过的,无法通过,引发类似下面的错误: error C2719: '_Val': formal parameter ...

  4. Python 模块collections

    1.深入理解python中的tuple的功能 基本特性 # 可迭代 name_tuple = ('0bug', '1bug', '2bug') for name in name_tuple: prin ...

  5. CentOS 7下给nginx安装SSL证书

    0. DNS要能解析你的网址(域名解析和主机解析,例如example.com和www.example.com都要能解析.注意泛解析记录*.example.com可以存在但在本文中暂时无法用于https ...

  6. commit lint规范化团队git提交信息

    一.快速提交符号angular编码规范的提交信息 1.命令行中安装commitizen: npm install -g commitizen commitizen init cz-convention ...

  7. python之路——7

    王二学习python的笔记以及记录,如有雷同,那也没事,欢迎交流,wx:wyb199594 复习 1. 小数据池 int -5---256 str 特殊字符 *202. ASCII码 8位 1字节 - ...

  8. Hive环境的安装

    hive是什么:hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能(HQL) hive有什么用 1.通过类SQL语句快速实现简单的Map ...

  9. array 的方法

  10. 使用css实现时间轴

    本文将使用css来实现一个左右交叉布局的时间轴,效果如下: 使用的都是一些常用的css,代码如下: <!DOCTYPE> <html> <head> <tit ...