码迷,mamicode.com
首页 > 其他好文 > 详细

nefu1173Dipper Landlord【乱搞】

时间:2016-05-12 17:42:08      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

 技术分享
The “Dipper Landlord” is a card game played by three people. In each game, there is a player is the landlord, the other 2 are farmers, each game score is x=6×2y (y is a non negative integer). If the Landlord wins the game, he will win the 2x points, both of 2 farmers lose x points. On the contrary, the farmers win, each farmer wins x points, the landlord lose 2x points.
Xiao Ming is the game scorer; he recorded the score of each player. But you wonder that he might be wrong, so you randomly choose a record to see if it‘s a valid score.
At the beginning of the game, each player is given 1000 points.

Input

There are several test cases end with EOF. For each test case, there are three integers in one line: r1,r2,r3, the score of three players.(-10,000≤r1,r2,r3≤10,000).

Output

For each case, output Yes if it‘s a valid score, No otherwise.

Sample Input

1000 1000 1000
1036 982 982
1015 994 991
1024 1024 950

Sample Output

Yes
Yes
No
No

昨天晚上比赛的题,老师最开始说前1个小时能出4个,我们前40分钟出了5个,然后这么一道题一直卡到最后,从第一名掉到倒数,全是泪==

题意:斗地主每次,地主赢的分数是平民的二倍,起始分数1000,问三个数是否合理,根本就不用判断那个差是否能被6整除!除了总和得3000以外就只有一个条件:每两个数的差必须是18的倍数!好桑心==

#include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
using namespace std;
int x1,x2,x3;
int num[3];
int main()
{
    while(~scanf("%d%d%d",&x1,&x2,&x3))
    {
        if(x1+x2+x3!=3000)
        puts("No");
        else
        {
            if((x1-x2)%18!=0||(x2-x3)%18!=0||(x1-x3)%18!=0)
            puts("No");
            else puts("Yes");
        }
    }
    return 0;
}


nefu1173Dipper Landlord【乱搞】

标签:

原文地址:http://blog.csdn.net/zhou_yujia/article/details/51360647

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!