Pokemon Master
Pokemon Master Time Limit : 4000/2000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)
Total Submission(s) : 15 Accepted Submission(s) : 8
Problem Description
Calem and Serena are pokemon masters. One day they decided to have a pokemon battle practice before Pokemon World Championships. Each of them has some pokemons in each's team. To make the battle more interesting, they decided to use a special rule to determine the winner: the team with heavier total weight will win the battle!
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
The first line contains two integers N and M (1 <= N, M <= 6), which describes that Calem has N pokemons and Serena has M pokemons.
The second line contains N integers indicating the weight of Calem's pokemons. The third line contains M integers indicating the weight of Serena's pokemons. All pokemons' weight are in the range of [1, 2094] pounds.
Output
For each test case, output "Calem" if Calem's team will win the battle, or "Serena" if Serena's team will win. If the two team have the same total weight, output "Draw" instead.
Sample Input
1
6 6
13 220 199 188 269 1014
101 176 130 220 881 396
Sample Output
Serena
package ACM1; import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Scanner; public class nyojw2
{
public static void main(String[]args)
{
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
for(int i=0;i<t;i++)
{
int n = scanner.nextInt();
int m = scanner.nextInt();
int sum1=0;
int sum2=0;
for(int j=0;j<n;j++)
{
sum1=sum1+scanner.nextInt(); }
for(int j=0;j<m;j++)
{ sum2=sum2+scanner.nextInt();
}
if(sum1==sum2)
System.out.println("Draw");
if(sum1<sum2)
System.out.println("Serena");
if(sum1>sum2)
System.out.println("Calem"); } }
}
当java的数组用不明白的时候减少用数组的频率,因当学一下ArryList 的用法
Pokemon Master的更多相关文章
- The 11th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Pokemon Master
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3776 题意:比较两组数据的总和大小. #include <iostr ...
- ZOJ 3776 A - Pokemon Master 签到水题
link 求和比大小... /** @Date : 2017-03-23-21.26 * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : http ...
- -------Pokemon Master------很水-------
A - Pokemon Master Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Sta ...
- Bash's Big Day
Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he we ...
- CodeForces757B
B. Bash's Big Day time limit per test 2 seconds memory limit per test 512 megabytes input standard i ...
- CodeForces757A
A. Gotta Catch Em' All! time limit per test 1 second memory limit per test 256 megabytes input stand ...
- 2012-2014 三年浙江 acm 省赛 题目 分类
The 9th Zhejiang Provincial Collegiate Programming Contest A Taxi Fare 25.57% (166/649) (水 ...
- Codeforces 757B. Bash's Big Day GCD
B. Bash's Big Day time limit per test:2 seconds memory limit per test:512 megabytes input:standard i ...
- 757A Gotta Catch Em' All!
A. Gotta Catch Em' All! time limit per test 1 second memory limit per test 256 megabytes input stand ...
随机推荐
- markdownPad2 绿色破解版安装
markdownpad2,默认为markdown传统风格,不能编辑分行的代码段,可以在设置里改为Github 风格,但需要付费激活,以下是绿色安装包,附激活方法 下载地址 https://pan.ba ...
- Android studio 混淆打包问题
参考 : Android Studio代码混淆设置以及上传mapping文件 AndroidStudio 混淆打包 在app 目录下 proguard-rules.pro中加入 通用 混淆 #指定代 ...
- GS给客户单发包以及m_queGcWait(所有GC共享)
GS给客户单发包以及m_queGcWait(所有GC共享) send_stat BaseChannel::SendCmd(int nCmd, void* pData, int nLen) { Prot ...
- 给this添加属性
const f =()=>{ console.log(this) let a=5 console.log(this) console.log(this) this.ak =3} f() let ...
- Django项目之【学员管理系统】
Django项目[学员管理系统] 项目规划阶段 项目背景 现实生活中,特别是在学校,传统的excel统计管理学员信息的方式已经无法满足日渐增长的业务需求. 因此需一套方便易用的“学员管理系统”,来提高 ...
- 我的Java开发学习之旅------>工具类:Java获取字符串和文件进行MD5值
ps:这几天本人用百度云盘秒传了几部大片到云盘上,几个G的文件瞬秒竟然显示"上传成功"!这真让我目瞪口呆,要是这样的话,那得多快的网速,这绝对是不可能的,也许这仅是个假象.百度了一 ...
- ALV TREE 实例
ALV TREE 实例 REPORT ZRPT_PS_PS021TREE . TABLES: PROJ, "项目定义数据 PRPS, "WBS元素数据 ZCJ30, "A ...
- Java实参和形参与传值和传引用
实参和形参的定义: 形参出现函数定义中,在整个函数体内都可以使用,离开函数则不能使用. 实参出现在主函数中,进入被调函数后,实参变量也不能使用. 形参和实参的功能是做数据传送.发生函数调用时,主调函数 ...
- linux删除目录下所有文件,但是保留文件夹
删除目录和子目录下所有rpm文件,但是保留文件夹,先cd到想要删除的目录 命令如下 find ./ -name "*.rpm" | xargs rm
- drawable canvas使用
/** * Drawable 就是一个可画的对象, * 其可能是一张位图(BitmapDrawable), * 也可能是一个图形(ShapeDrawable), * 还有可能是一个图层(LayerDr ...