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 ...
随机推荐
- SSH 使用密钥登录并禁止口令登录
小结:修改下sshd配置文件,把公钥传上去就好了 先生成公钥和私钥,默认在/root/.ssh/目录,可以先看一下有没有这个目录. 生成公钥后,以后其它服务器也都可以复用这个公钥 最好生成时输入密码! ...
- 01 redis特点及安装使用
一:redis的特点 ()redis是一个开源,BSD许可高级的key-value存储系统.可以用来存储字符串,哈希结构,链表,集合,因此,常用来提供数据结构服务. 二:redis和memcached ...
- 百思不得姐之"我的"模块功能(六)
一 功能图和知识点 1 功能图部分:(因为网速的原因,网页部分没有载入出来,可是功能完善) 2 该部分能学到的知识点概括: >1 UITableView的使用(简单) >2 UIColle ...
- Docker中部署puppeteer导出pdf
最近在做puppeteer容器化的过程中发现问题. 在容器中npm install puppeteer仍然会报错,不能launch 随后错误提示中也给出了官方的文档,https://github.co ...
- JavaScript演示如何访问Search字段
<!DOCTYPE html> <html> <body> <h3>演示如何访问Search字段</h3> <input type=& ...
- 大家都是怎么看待STO的?
STO,全称为「Security Token Offer」,即证券型通证发行.STO是2017年底从美国开始流行的,对于在美国注册的公司,STO是一个合法合规的ICO. 对于STO,大家都是怎么看待的 ...
- 怎样做大做强企业中的ERP?
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/luozhonghua2014/article/details/37672409 ...
- [容易]合并排序数组 II
题目来源:http://www.lintcode.com/zh-cn/problem/merge-sorted-array/
- 【zabbix】微信告警消息模版
下面给出了一个zabbix微信告警消息的模版, 消息最后加上#号和短横线的设计有两个原因: 1,zabbix的微信告警消息总是被截断,比如最后一个告警时间,如果没有最后一行#号,在微信上看的时候时间不 ...
- vue 动态传值笔记
:prop="'answers.a' + item.split('.')[1]+'.total'" {{scope.row.answers['a'+item.split('.')[ ...