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,要求求. 输入输出格式 ...
随机推荐
- Java基础语法:基本数据类型
Java是一种强类型语言,每个变量都必须声明其类型. Java的数据类型 分为两大类:基本类型(primitive type)和引用类型(reference type). Java的所有八种基本类型的 ...
- alpine jdk 中文乱码
一.概述 使用alpine镜像构建了一个oracle jdk的镜像,运行java业务时,查看日志,显示中文乱码. 但是,基于Alpine Linux的Docker基础镜像的镜像文件很小,也有代价: 把 ...
- 大话Spark(5)-三图详述Spark Standalone/Client/Cluster运行模式
之前在 大话Spark(2)里讲过Spark Yarn-Client的运行模式,有同学反馈与Cluster模式没有对比, 这里我重新整理了三张图分别看下Standalone,Yarn-Client 和 ...
- 记录安装freeswitch的日常
已知安装版本:Linux:Centos7 Freeswitch:1.10.2 解: 注意:(最好呢是先下载好包,然后上传到这个所用的环境中) 1.安装对应依赖 yum install -y git a ...
- .NET并发编程-反应式编程
本系列学习在.NET中的并发并行编程模式,实战技巧 本小节开始学习反应式编程.本系列保证最少代码呈现量,虽然talk is cheap, show me the code被奉为圭臬,我的学习习惯是,只 ...
- CVE-2020-1938 -Tomcat-AJP任意文件读取/包含
为什么这个漏洞被称作 Ghostcat(幽灵猫)? 这个漏洞影响全版本默认配置下的 Tomcat(在我们发现此漏洞的时候,确认其影响 Tomcat 9/8/7/6 全版本,而年代过于久远的更早的版本未 ...
- 一篇看懂JVM底层详解,利用class反编译文件了解文件执行流程
JVM之内存结构详解 JVM内存结构 java虚拟机在执行程序的过程中会将内存划分为不同的区域,具体如图1-1所示. 五个区域 JVM分为五个区域:堆.虚拟机栈.本地方法栈.方法区(元空间).程序计数 ...
- [unknown source] 快乐树
一.题目 题目描述 有一棵 \(n\) 个节点的数,每个点有点权 \(a_i\),定义一条路径的权值为路径上所有点的异或和,求所有路径的权值和,有 \(q\) 次修改,每次改一个点的点权. 数据范围 ...
- [笔记] 扩展Lucas定理
[笔记] 扩展\(Lucas\)定理 \(Lucas\)定理:\(\binom{n}{m} \equiv \binom{n/P}{m/P} \binom{n \% P}{m \% P}\pmod{P} ...
- 《进击吧!Blazor!》系列入门教程 第一章 7.图表
<进击吧!Blazor!>是本人与张善友老师合作的Blazor零基础入门教程视频,此教程能让一个从未接触过Blazor的程序员掌握开发Blazor应用的能力. 视频地址:https://s ...