-------Pokemon Master------很水-------
A - Pokemon Master
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu
Submit Status
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 ( <= N, M <= ), 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 Sample Output
Serena
臭长题目其实没有多少技术含量.
意思就是 第一行数据是测试案例数. 第二行是 每个人拥有的拥有的什么鬼东西的重量,让你求出分别拥有的重量之和,谁的大谁就赢了.平局的话输出平局.
#include<stdio.h>
int main()
{
int t, n, m;
scanf("%d", &t);
while (t--)
{
scanf("%d %d", &n, &m);
int i, num, s1 = , s2 = ;
for (i = ; i < n; i++)
{
scanf("%d", &num);
s1 += num;
}
for (i = ; i < m; i++)
{
scanf("%d", &num);
s2 += num;
}
if (s1 == s2)
printf("Draw");
else
printf(s1 > s2 ? "Calem" : "Serena"); //这里运用了三目运算符 很节省篇幅.......值得学习,如果?之前的条件成立的话,就执行紧挨着的,否则就执行:后面的
}
return ;
}
-------Pokemon Master------很水-------的更多相关文章
- ZOJ 3776 A - Pokemon Master 签到水题
link 求和比大小... /** @Date : 2017-03-23-21.26 * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : http ...
- 【jQuery基础学习】09 jQuery与前端(这章很水)
这章主要是将如何将jQuery应用到网站中,或者说其实就是一些前端知识,对于我这种后端程序来说其实还是蛮有用的. 关于网站结构 文件结构 前端文件分三个文件夹放 images文件夹用来存放将要用到的图 ...
- Pokemon Master
Pokemon Master Time Limit : 4000/2000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other) Total ...
- 『NYIST』第八届河南省ACM竞赛训练赛[正式赛一]-CodeForces 236A,虽然很水,但有一个很简单的函数用起来方便
A. Boy or Girl time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- FZU 2205 据说题目很水
2205 据说题目很水 Accept: 199 Submit: 458Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Descr ...
- 2015南阳CCPC A - Secrete Master Plan 水题
D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Master Mind KongMing gave ...
- hdu 3295 模拟过程。数据很水
An interesting mobile game Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Ja ...
- FZUOJ 2205 据说题目很水 (无三元环图最大边数)
Problem Description Sunday最近对图论特别感兴趣,什么欧拉回路什么哈密顿回路,又是环又是树.在看完一本书后,他对自己特别有信心,便找到大牛牛犇犇,希望他出一题来考考自己. 在遥 ...
- 2753:走迷宫(dfs+初剪)//可以说是很水了。。。
总时间限制: 1000ms 内存限制: 65536kB 描述 一个迷宫由R行C列格子组成,有的格子里有障碍物,不能走:有的格子是空地,可以走.给定一个迷宫,求从左上角走到右下角最少需要走多少步(数 ...
- POJ 2080 Calendar(很水的模拟)
刚开始一直WA,才发现原来代码中两处减去年份.月份的天数的判断条件用的是>=,虽然最后考虑n=0要退回一天的情况,但还是WA.后来改成>的条件判断,省去了考虑n=0的麻烦,AC. 此题无非 ...
随机推荐
- ZOJ 3471 【状态压缩DP】
题意: 有n种化学物质,他们彼此反应会有一种消失并释放出能量. 给出矩阵,第i行j列代表i和j反应j消失释放的能量. 求最大释放多少能量. 思路: 状态压缩DP,我是这么想的. 利用二进制0代表该物质 ...
- 《springMVC》学习笔记
1.SpringMVC框架 1.1 MVC在b/s系统下的应用 用户发送request请求到Controller Controller请求模型(Model)进行处理 Model将处理结果返回到Cont ...
- ASP.net MVC+ViewData VS ViewBag
在使用MVC框架的过程中,往界面传值,我们使用的ViewData.如ITOO部分代码图解: 当然除了ViewData,我们还能够使用同卵兄弟(ViewBag)来完毕相同的功能,详情 ...
- Highcharts:X轴分组堆叠图
在设计一个项目中的数据展示页面时.想要设计双X轴,一个轴显示须要的项.一个轴对这些项进行分组.效果如图: Highcharts自带双X轴展示方式.可是效果不是太理想.调整起来也会麻烦些 看到Highc ...
- Linux——系统调用笔记1
底层文件访问: 进程:运行中的程序,它有一些与值关联的文件描述符,有多少个文件描述符取决于系统配置情况. 当一个程序开始运行时,一般会打开三个文件描述符: 0:标准输入 ...
- Android 中间人攻击
0x00 Android中间人攻击的思路就是劫持局域网中被攻击机器和server间的对话.被攻击机器和server表面上工作正常,实际上已经被中间人劫持.能够从一张图来明确这个过程. 受攻击主机发送的 ...
- MySQL InnoDB类型数据库的恢复
MySQL的数据库文件直接复制便可以使用,但是那是指“MyISAM”类型的表. 而使用MySQL-Front直接创建表,默认是“InnoDB”类型,这种类型的一个表在磁盘上只对应一个“*.frm”文 ...
- Python爬虫开发【第1篇】【爬虫案例】
案例一:网站模拟登录 # douban.py from selenium import webdriver from selenium.webdriver.common.keys import Key ...
- 多媒体开发之---h.264 rtsp网络流测试流
rtsp://218.204.223.237:554/live/1/66251FC11353191F/e7ooqwcfbqjoo80j.sdp 珠海拱北
- js可视区域图片懒加载
可视区域图片懒加载 实现原理,页面滚动时获取需要懒加载的图片,判断此图片是否在可视区域内,是则设置图片data-src地址为src地址,加载图片. html下载地址 <!DOCTYPE html ...