D - 下个也是签到题 FZU - 2221(博弈)
ZB loves watching RunningMan! There's a game in RunningMan called 100 vs 100.
There are two teams, each of many people. There are 3 rounds of fighting, in each round the two teams send some people to fight. In each round, whichever team sends more people wins, and if the two teams send the same amount of people, RunningMan team wins. Each person can be sent out to only one round. The team wins 2 rounds win the whole game. Note, the arrangement of the fighter in three rounds must be decided before the whole game starts.
We know that there are N people on the RunningMan team, and that there are M people on the opposite team. Now zb wants to know whether there exists an arrangement of people for the RunningMan team so that they can always win, no matter how the opposite team arrange their people.
Input
The first line contains an integer T, meaning the number of the cases. 1 <= T <= 50.
For each test case, there's one line consists of two integers N and M. (1 <= N, M <= 10^9).
Output
For each test case, Output "Yes" if there exists an arrangement of people so that the RunningMan team can always win. "No" if there isn't such an arrangement. (Without the quotation marks.)
Sample Input
2
100 100
200 100
Sample Output
No
Yes
Hint
In the second example, the RunningMan team can arrange 60, 60, 80 people for the three rounds. No matter how the opposite team arrange their 100 people, they cannot win.
AC代码:
1 #include<stdio.h>
2 #include<string.h>
3 #include<algorithm>
4 using namespace std;
5 int main()
6 {
7 int t;
8 int n,m;
9 scanf("%d",&t);
10 while(t--)
11 {
12 scanf("%d%d",&n,&m);
13 if((n+1)*1.0>=(m*3/2))
14 printf("Yes\n");
15 else
16 printf("No\n");
17 }
18 return 0;
19 }
和队友在那看了一个多小时,各种提交各种错,看过别人的代码后发现是少乘了个1.0真是无语了。
D - 下个也是签到题 FZU - 2221(博弈)的更多相关文章
- B - 真·签到题 FZU - 2214(背包)
Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the item ...
- EOJ Monthly 2019.1 唐纳德先生与这真的是签到题吗 【数学+暴力+multiset】
传送门:https://acm.ecnu.edu.cn/contest/126/ C. 唐纳德先生与这真的是签到题吗 单测试点时限: 6.0 秒 内存限制: 1024 MB 唐纳德先生在出月赛的过程中 ...
- P3694 邦邦的大合唱站队/签到题(状压dp)
P3694 邦邦的大合唱站队/签到题 题目背景 BanG Dream!里的所有偶像乐队要一起大合唱,不过在排队上出了一些问题. 题目描述 N个偶像排成一列,他们来自M个不同的乐队.每个团队至少有一个偶 ...
- 2016-2017学年第三次测试赛 问题 F: 签到题
问题 F: 签到题 时间限制: 1 Sec 内存限制: 128 MB提交: 80 解决: 28 提交统计讨论版 题目描述 在计算机网络考试中, 黑帅男神看到一个将IP网络分类的题, 精通C++的他 ...
- XC1263 签到题(哇 ,写得我怀疑人生啊!!!@!@)
1263: 签到题 时间限制: 1 Sec 内存限制: 128 MB提交: 174 解决: 17 标签提交统计讨论版 题目描述 大家刚过完寒假,肯定还没有进入状态,特意出了一道签到题给各位dala ...
- A 洛谷 P3601 签到题 [欧拉函数 质因子分解]
题目背景 这是一道签到题! 建议做题之前仔细阅读数据范围! 题目描述 我们定义一个函数:qiandao(x)为小于等于x的数中与x不互质的数的个数. 这题作为签到题,给出l和r,要求求. 输入输出格式 ...
- fjwc2019 D3T1 签到题 (贪心)
#184. 「2019冬令营提高组」签到题 每次询问接近O(1).......考虑贪心 怎么贪心呢? 对于相邻的两个数,我们要保证异或x后单调不降 我们找到两个数二进制上最高的相异位 当左边的数相异位 ...
- CTF-练习平台-WEB之 签到题
一.签到题 根据提示直接加群在群公告里就能找到~
- 洛谷P3601签到题(欧拉函数)
题目背景 这是一道签到题! 建议做题之前仔细阅读数据范围! 题目描述 我们定义一个函数:qiandao(x)为小于等于x的数中与x不互质的数的个数. 这题作为签到题,给出l和r,要求求. 输入输出格式 ...
随机推荐
- Linux下搭建ZooKeeper集群
摘要 Zookeeper是针对大型分布式系统的高可靠的协调系统.它基于对Paxos算法的实现,使该框架保证了分布式环境中数据的强一致性,也正是基于这样的特性,使得ZooKeeper解决很多分布式问题. ...
- CF1491C Pekora and Trampoline 题解
题目链接 比赛时只想到了 \(\mathcal O(n^3)\) 的暴力做法,官方题解是 \(\mathcal O(n^2)\) ,并且是可以优化为 \(\mathcal O(n)\) 的(贪心+ ...
- createNewFile() 报错 open failed: ENOENT (No such file or directory) 的解决方案
在写Android应用中使用createNewFile() 遇到open failed: ENOENT (No such file or directory) 错误,在网上查了许多方法,不过都不能解决 ...
- 记录 Allsec 解题过程
开局打开URL:http://119.3.191.245:65532/#/allsecPlayGame,前去做游戏 游戏URL:http://119.3.191.245:8877/Login.php ...
- 我与FreeBSD的故事之一
记得还是那些无聊的日子,群里有网友称Linux只能玩WPS,我表示质疑,并通过百度这个搜索引擎搜索到了Ubuntu Kylin,即由湖南的国防科技大学与Ubuntu社区合作并由其主导的Ubuntu麒麟 ...
- Python--入门接口测试(1)
1. 什么是接口测试?为什么要做接口测试? 接口测试是测试系统组件间接口的一种测试.接口测试主要用于检测外部系统与系统之间以及内部各个子系统之间的交互点.测试的重点是要检查数据的交换.传递和控制管理过 ...
- C#开发BIMFACE系列38 网页集成开发2:审图系统中的模型或图纸批注
系列目录 [已更新最新开发文章,点击查看详细] 在运维或协同的场景中,经常需要对模型或图纸进行批注,及时记录已发现的问题并交给相关负责的人员. 在开始实现功能之前,先了解一下BIMFACE中有 ...
- P2516 [HAOI2010]最长公共子序列 题解(LCS)
题目链接 最长公共子序列 解题思路 第一思路: 1.用\(length[i][j]\)表示\(a\)串的前\(i\)个字符与\(b\)串的前\(j\)个字符重叠的最长子串长度 2.用\(num[i][ ...
- Java中的四种权限修饰符及六种非访问修饰符(简识)
一.是哪四种访问权限修饰符呢? public > protected > [default] > private (公共的 ) (受保护的) (默认的) (私有的) 二.简单认识四种 ...
- 从零学脚手架(七)---webpack-dev-server使用
如果此篇对您有所帮助,在此求一个star.项目地址: OrcasTeam/my-cli webpack-dev-server使用 什么是webpack-dev-server 使用vue-cli .re ...