A. Mishka and Game
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the game.
Rules of the game are very simple: at first number of rounds n is defined. In every round each of the players throws a cubical dice with distinct numbers from 1 to 6 written on its faces. Player, whose value after throwing the dice is greater, wins the round. In case if player dice values are equal, no one of them is a winner.
In average, player, who won most of the rounds, is the winner of the game. In case if two players won the same number of rounds, the result of the game is draw.
Mishka is still very little and can't count wins and losses, so she asked you to watch their game and determine its result. Please help her!
InputThe first line of the input contains single integer n n (1 ≤ n ≤ 100) — the number of game rounds.
The next n lines contains rounds description. i-th of them contains pair of integers mi and ci (1 ≤ mi, ci ≤ 6) — values on dice upper face after Mishka's and Chris' throws in i-th round respectively.
OutputIf Mishka is the winner of the game, print "Mishka" (without quotes) in the only line.
If Chris is the winner of the game, print "Chris" (without quotes) in the only line.
If the result of the game is draw, print "Friendship is magic!^^" (without quotes) in the only line.
Examplesinput3
3 5
2 1
4 2outputMishkainput2
6 1
1 6outputFriendship is magic!^^input3
1 5
3 3
2 2outputChrisNoteIn the first sample case Mishka loses the first round, but wins second and third rounds and thus she is the winner of the game.
In the second sample case Mishka wins the first round, Chris wins the second round, and the game ends with draw with score 1:1.
In the third sample case Chris wins the first round, but there is no winner of the next two rounds. The winner of the game is Chris.
A题居然这么水!!昨晚cf挤爆好不容易刷进去发现A题就是一道比较大小??!居然还到了七分钟才交TAT。
水AC代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std; int main(){
int n,b,c;
cin>>n;
int x=,y=;
while(n--){
cin>>b>>c;
if(b>c)
x++;
if(b<c)
y++;
}
if(x>y){
cout<<"Mishka";
}
if(y>x){
cout<<"Chris";
}
if(x==y){
cout<<"Friendship is magic!^^";
}
return ;
}
说实话这种题贴出来就是为了凑篇幅啊 嘛..用来掩盖我好些天偷懒没更博客的事实【雾!
A. Mishka and Game的更多相关文章
- CF #365 (Div. 2) D - Mishka and Interesting sum 离线树状数组
题目链接:CF #365 (Div. 2) D - Mishka and Interesting sum 题意:给出n个数和m个询问,(1 ≤ n, m ≤ 1 000 000) ,问在每个区间里所有 ...
- CF #365 (Div. 2) D - Mishka and Interesting sum 离线树状数组(转)
转载自:http://www.cnblogs.com/icode-girl/p/5744409.html 题目链接:CF #365 (Div. 2) D - Mishka and Interestin ...
- Codeforces Round #365 (Div. 2) Mishka and trip
Mishka and trip 题意: 有n个城市,第i个城市与第i+1个城市相连,他们边的权值等于i的美丽度*i+1的美丽度,有k个首都城市,一个首都城市与每个城市都相连,求所有边的权值. 题解: ...
- Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum 离线+线段树
题目链接: http://codeforces.com/contest/703/problem/D D. Mishka and Interesting sum time limit per test ...
- cf703B Mishka and trip
B. Mishka and trip time limit per test 1 second memory limit per test 256 megabytes input standard ...
- cf703A Mishka and Game
A. Mishka and Game time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- CodeForces 703A Mishka and Game
简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...
- Mishka and Interesting sum
Mishka and Interesting sum time limit per test 3.5 seconds memory limit per test 256 megabytes input ...
- CF #365 703D. Mishka and Interesting sum
题目描述 D. Mishka and Interesting sum的意思就是给出一个数组,以及若干询问,每次询问某个区间[L, R]之间所有出现过偶数次的数字的异或和. 这个东西乍看很像是经典问题, ...
- 暑假练习赛 003 F Mishka and trip
F - Mishka and trip Sample Output Hint In the first sample test: In Peter's first test, there's on ...
随机推荐
- 【mac】屏幕截图快捷键
这里只说四种 1.command+shift+4 截图是区域截图,会自动保存在桌面上 2.command+shift+control+4 区域截图,截图会自动保存在剪切板中,然后你可以通过comman ...
- Solidworks如何运行Toolbox
现在的问题不是没安装,没配置,这两项已经勾选了 Toolbox也配置到第五步了,但是没有什么"完成"按钮,我只能点击关闭把这个窗口关了,而且下次要拉一颗螺丝进来也不行 这样 ...
- LInux查看CPU状态
1.htop 2.top 内容解释: PID:进程的ID USER:进程所有者 PR:进程的优先级别,越小越优先被执行 NInice:值 VIRT:进程占用的虚拟内存 RES:进程占用的物理内存 SH ...
- 聊聊高并发(三十二)实现一个基于链表的无锁Set集合
Set表示一种没有反复元素的集合类,在JDK里面有HashSet的实现,底层是基于HashMap来实现的.这里实现一个简化版本号的Set,有下面约束: 1. 基于链表实现.链表节点依照对象的hashC ...
- 作为iOS程序员,最核心的60%能力有哪些?
作为iOS程序员,最核心的60%能力有哪些? 一个合格的iOS程序员需要掌握多少核心技能?你和专业的开发工程师的差距有多大?你现在的水平能开发一个功能完整性能高效的iOS APP吗?一起来看看下面 ...
- 探索Scala(3)-- 单例对象
研究一下Scala语言的单例对象(Singleton Objects),为下一篇文章做准备. static不是keyword 上一篇文章提到过,interface并非Scala语言keyword,能够 ...
- dubbo简单配置与使用
dubbo简介 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 单一应用架构 当网站流量很小时 ...
- Comparing Random and Sequential Access in Disk and Memory
The Pathologies of Big Data - ACM Queue https://queue.acm.org/detail.cfm?id=1563874
- YARN commands are invoked by the bin/yarn script.
Apache Hadoop 2.9.0 – YARN Commands http://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-sit ...
- 在安卓6.0(及以上)设备上无法获取无线网卡MAC地址的解决方案
在安卓6.0以下的设备上,通过WifiManager.getConnectionInfo().getMacAddress()即可获取WLAN物理地址, 而在6.0及以上,以此方式获取到的MAC地址为固 ...