FZU 2221—— RunningMan——————【线性规划】
Accept: 17 Submit: 52
Time Limit: 1000 mSec Memory Limit : 32768 KB
Problem Description
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
Sample Output
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.
Source
第六届福建省大学生程序设计竞赛-重现赛(感谢承办方华侨大学)
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
int T,n,m;
scanf("%d",&T);
while(T--){
scanf("%d%d",&n,&m);
if(n >= 1.5*(m-1)){
puts("Yes");
}else{
puts("No");
}
}
return 0;
}
FZU 2221—— RunningMan——————【线性规划】的更多相关文章
- FZU 2221 RunningMan(跑男)
Problem Description 题目描述 ZB loves watching RunningMan! There's a game in RunningMan called 100 vs 10 ...
- Problem 2221 RunningMan(fuzoj)
Problem 2221 RunningMan Accept: 130 Submit: 404Time Limit: 1000 mSec Memory Limit : 32768 KB ...
- FZU Problem 2221 RunningMan(贪心)
一开始就跑偏了,耽误了很长时间,我和队友都想到博弈上去了...我严重怀疑自己被前几个博弈题给洗脑了...贪心的做法其实就是我们分两种情况,因为A先出,所以B在第一组可以选择是赢或输,如果要输,那直接不 ...
- D - 下个也是签到题 FZU - 2221(博弈)
ZB loves watching RunningMan! There's a game in RunningMan called 100 vs 100. There are two teams, e ...
- FZOJ--2221-- RunningMan(水题)
Problem 2221 RunningMan Accept: 4 Submit: 10 Time Limit: 1000 mSec Memory Limit : 32768 KB Pro ...
- FZU 2137 奇异字符串 后缀树组+RMQ
题目连接:http://acm.fzu.edu.cn/problem.php?pid=2137 题解: 枚举x位置,向左右延伸计算答案 如何计算答案:对字符串建立SA,那么对于想双延伸的长度L,假如有 ...
- FZU 1914 单调队列
题目链接:http://acm.fzu.edu.cn/problem.php?pid=1914 题意: 给出一个数列,如果它的前i(1<=i<=n)项和都是正的,那么这个数列是正的,问这个 ...
- ACM: FZU 2105 Digits Count - 位运算的线段树【黑科技福利】
FZU 2105 Digits Count Time Limit:10000MS Memory Limit:262144KB 64bit IO Format:%I64d & ...
- FZU 2112 并查集、欧拉通路
原题:http://acm.fzu.edu.cn/problem.php?pid=2112 首先是,票上没有提到的点是不需要去的. 然后我们先考虑这个图有几个连通分量,我们可以用一个并查集来维护,假设 ...
随机推荐
- 「BZOJ 3209」花神的数论题
Title Link 戳我 Title Solution 这道题可以运用组合数的思想啊,数位dp也可以,随便你怎么做,这里就讲一讲组合数的做法吧,要小于n,所以我们可以枚举n二进制下1的位置,在i-1 ...
- web静态资源的访问(笔记)
1.在web-inf外的静态资源访问: 三种方式: 2.访问web-inf内的静态资源: 使用请求转发的方式访问web-inf静态资源(重定向相当于在浏览器输入,无法访问) 参考:https://bl ...
- Multimap的初使用
之前不知道这个类型使用,在朋友的推荐下进行了个实际操作. 类似这种查询,我需要将他们归类拿出来,如果招以前那么拿的话可能要套挺多个循环的. 首先根据查询得到一个 List<Map<Stri ...
- 【SSO单点系列】(5):CAS4.0 单点流程序列图
刚过元旦假期,感觉自己好久没写博客了,今天更新一篇,主要是CAS 的一个流程图. ps: 这两张图 是直接从官网上找的,都是简单的英语,我这种英语四级没过都看得懂,大家应该没有压力. 1.CAS 基本 ...
- 老男孩Day11作业:selectors版socket
一.作业需求: 使用SELECT或SELECTORS模块实现并发简单版FTP 允许多用户并发上传下载文件 二.readme 一.作业需求: 使用SELECT或SELECTORS模块实现并发简单版FTP ...
- 谈谈php中抽象类和接口的区别
php中抽象类和接口的区别 1) 概念 面向对象的三大概念:封装,继承,多态 把属性和方法封装起来就是类. 一个类的属性和方法被另外的类复制就是继承,PHP里面的任何类都可以被继承,被继 ...
- 在Discuz X 中增加一个单独的页面
如果在DZ中增加一个新的页面,并且取得DZ中相关的用户等乱七八糟的属性,在旧的版本中只要引用一个 -. comm.php 文件就可以,但是在 X 版本以后好像就没.还好,X版本中还是有办法解决的,使用 ...
- 6. 重点来啦,pytest的各种装饰圈fixtures
pytest中,fixture的目的是什么 为可靠的和可重复执行的测试提供固定的基线.(可以理解为测试的固定配置,使不同范围的测试都能够获得统一的配置.) fixture提供了区别于传统单元测试(se ...
- redis读取自增时候指定的key问题
首先,此文章是接了如下文章写的 Spring boot redis自增编号控制 踩坑 上面这个问题解决后,公司这边功能其实已经实现了,但是考虑到一种情况,因为我们这边号的生成就是根据上面的自增编号来的 ...
- js自定义对象 (转)
原文地址:https://sjolzy.cn/js-custom-object.html 29 March 2010 9:53 Monday by 小屋 javascript进阶之对象篇 一,概述 在 ...