BestCoder Round #58 (div.2)Card Game(hdu5494)
来源:互联网 发布:java监听器使用方法 编辑:程序博客网 时间:2024/06/03 22:42
Card Game
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 46 Accepted Submission(s): 42
Problem Description
Soda and Beta are good friends. They are going to play a card game today. Soda has n cards with number a1,a2,...,an while Beta has n cards with number b1,b2,...,bn .
First, they choose a numberm no larger than n . Then they both randomly select m cards from their own n cards. The one with larger sum of the selected cards will win. Soda wants to know if he can always win no mater what cards will be randomly selected from him and Beta.
First, they choose a number
Input
There are multiple test cases. The first line of input contains an integer T(1≤T≤100) , indicating the number of test cases. For each test case:
The first line contains two integern and m (1≤m≤n≤500) . The second line contains n integers a1,a2,...,an (1≤ai≤1000) denoting Soda's cards. The third line contains n integers b1,b2,...,bn (1≤bi≤1000) denoting Beta's cards.
The first line contains two integer
Output
For each test case, output "YES" (without the quotes) if Soda can always win, otherwise output "NO" (without the quotes) in a single line.
Sample Input
23 14 5 61 2 35 23 4 7 8 93 4 5 2 3
Sample Output
YESNO
Source
BestCoder Round #58 (div.2)
简单题,直接上代码。
哎!由于题目看错导致WA一发
0 0
- hdu5494 Card Game(BestCoder Round #58 (div.2))
- BestCoder Round #58 (div.2)Card Game(hdu5494)
- BestCoder Round #58 (div.2)HDU5494 Card Game
- BestCoder Round #58 Card Game 即 hdu5494 (排序)
- HDU 5494 Card Game(排个序就可以了)——BestCoder Round #58(div.2)
- hdu5494 ( Card Game )
- BestCoder Round #61 (div.2) HDU5523 Game
- BestCoder Round #61 (div.2) Game
- BestCoder Round #58 (div.2)
- Codeforces Round #263 (Div. 2)B. Appleman and Card Game
- Codeforces Round #263 (Div. 2)B. Appleman and Card Game
- Codeforces Round #263 (Div. 2)-B. Appleman and Card Game
- hdu 5523 Game 【BestCoder Round #61 (div.2)】
- BestCoder Round #11 (Div. 2)
- BestCoder Round #11 (Div. 2)
- BestCoder Round #50 (div.2)
- BestCoder Round #50 (div.2)
- BestCoder Round 50 (div 2)
- Aspects 源代码解析<一>
- 【Pascal】 天软提取期权数据代码
- 基础知识点
- Find the Duplicate Number【287】
- 独立日记 2015年10月3日 变量名的力量
- BestCoder Round #58 (div.2)Card Game(hdu5494)
- android--day02(UI、事件)
- 第二层内容:枚举
- 求出长度为1, 2, 3, 4, 5....的字符串最大出现次数 后缀数组 UVA 11855 - Buzzwords
- CSDN下载积分获取
- sql性能优化 - sql查询优化
- 网上看到的X度移动端笔试题
- Android ListView多布局复用ArrayIndexOutOfBoundsException问题
- sql性能优化 - 数据库对象优化