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. erlang进程监控:link和monitor

    Erlang最开始是为了电信产品而发展起来的语言,因为这样的目的,决定了她对错误处理的严格要求.Erlang除了提供exception,try catch等语法,还支持Link和Monitor两种监控 ...

  2. Docker入门系列5:常见问题小结

    重启容器 再次运行容器: docker start container_id 然后 docker attach container_id 就可以继续下命令了. [编辑]命名 --name [编辑]端口 ...

  3. 一些编译php时的configure 参数

    一些编译php时的configure 参数 ./configure –prefix=/usr/local/php php 安装目录 –with-apxs2=/usr/local/apache/bin/ ...

  4. 特权级概述(哥子就想知道CPU是如何验证特权级的)GATE+TSS

    [0]README text description from orange's implemention of a os . [1]特权级概述 当当前代码段试图访问一个段或者门时,目标段的DPL将会 ...

  5. C#连接Oracle的问题(不安装客户端)

     win7环境,本地没有安装oracle或者客户端,现在需要程序里连接远程oracle DB: 如果采用System.Data.OracleClient肯定是不行的,这个要安装客户端的: 所以就尝试O ...

  6. animate和scrollTop的使用

    // 平滑滚动到ola结果位置 var scrollHeight = $("#wrap_div")[0].scrollHeight; var curDivHeight = $(&q ...

  7. 【题解】[P3557 POI2013]GRA-Tower Defense Game

    [题解][P3557 POI2013]GRA-Tower Defense Game 这道题是真的** 根据题目给的\(k\),可以知道,我们随便放塔,只要不全放一起,一定是一种合法的方案. 直接枚举就 ...

  8. ELK日志收集系统搭建

     架构图 ELK  架构图:其中es 是集群,logstash 是单节点(猜想除非使用nginx对log4j的网络输出分发),kibana是单机(用不着做成集群). 1.拓扑图 2.logstash ...

  9. php 生成bing词典能导入的xml(有道词典->bing词典)

    编程以来一直用网易有道词典查单词.翻译:最近一直在看英文方面的资料,于是越来越对有道词典(划词.广告,本来想转灵格斯的,但灵格斯没有android版)不满意,一番试用后决定转bing词典,于是想把有道 ...

  10. TopCoder<SRM>上的一道1100分的题目解析附代码

    首先我们来简单看一下这道题的statement Problem Statement      Note that in the following problem statement, all quo ...