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的更多相关文章

  1. The 11th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Pokemon Master

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3776 题意:比较两组数据的总和大小. #include <iostr ...

  2. ZOJ 3776 A - Pokemon Master 签到水题

    link 求和比大小... /** @Date : 2017-03-23-21.26 * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : http ...

  3. -------Pokemon Master------很水-------

    A - Pokemon Master Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Sta ...

  4. Bash's Big Day

    Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he we ...

  5. CodeForces757B

    B. Bash's Big Day time limit per test 2 seconds memory limit per test 512 megabytes input standard i ...

  6. CodeForces757A

    A. Gotta Catch Em' All! time limit per test 1 second memory limit per test 256 megabytes input stand ...

  7. 2012-2014 三年浙江 acm 省赛 题目 分类

    The 9th Zhejiang Provincial Collegiate Programming Contest A    Taxi Fare    25.57% (166/649)     (水 ...

  8. 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 ...

  9. 757A Gotta Catch Em' All!

    A. Gotta Catch Em' All! time limit per test 1 second memory limit per test 256 megabytes input stand ...

随机推荐

  1. 深入浅出Stream和parallelStream

    https://blog.csdn.net/darrensty/article/details/79283146

  2. linux 读取文件信息并且输出

    版权为个人所有,欢迎转载如转载请说明出处.(东北大亨) http://www.cnblogs.com/northeastTycoon/p/5513231.html 以下为读取文件信息做输出操作. 1. ...

  3. CAS实现单点登录理解

    CAS 是 Yale 大学发起的一个企业级的.开源的项目,旨在为 Web 应用系统提供一种可靠的单点登录解决方法(属于 Web SSO ),CAS 开始于 2001 年, 并在 2004 年 12 月 ...

  4. cocos2d-js添加百度appx的插屏广告(通过jsb反射机制)

    本来一直用的anysdk接入广告,结果从前几天开始,百度商店的审核总是通不过,结果一问才知道:要上传到百度商店就必须要用百度的appx(真的是各种坑,我们这些个人开发者迟早要被你们大公司玩死),没办法 ...

  5. mysql系列之7.mysql读写分离

    准备 下载如下linux安装包 jdk-6u31-linux-x64-rpm.bin amoeba-mysql-binary-2.2.0.tar.gz # crontab -e  //同步时间 */ ...

  6. Java for LeetCode 082 Remove Duplicates from Sorted List II

    Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...

  7. [2018-05-27]配置VSTS认证方式使用Personal Access Token

    本文介绍下如何配置VSTS(visual studio team service,其实就是微软SaaS版的TFS)通过Personal Access Token访问其下的Git代码库. 问题 使用gi ...

  8. Delphi编写WebService体会

    源:Delphi编写WebService体会 Dispatch: 派遣,分派 Invoke: 调用 Invokable: 可调用接口 TReomtable: WebService中自定义类都是继承自该 ...

  9. Mac OS访问Windows共享文件夹

    原文地址:http://blog.csdn.net/jinhill/article/details/7246922 最近开始研究Mac OS,遇到的第一个问题就是如何在Mac OS中访问Windows ...

  10. struts2 codebehind + actionPackages 实现Action零配置

    1.jar包:struts2-codebehind-plugin-2.2.1.1.jar 2.struts.xml:<!-- codebehind中查找action的返回结果资源时的默认文件夹 ...