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 ...
随机推荐
- 第24章、OnLongClickListener长按事件(从零开始学Android)
在Android App应用中,OnLongClick事件表示长按2秒以上触发的事件,本章我们通过长按图像设置为墙纸来理解其具体用法. 知识点:OnLongClickListener OnLongCl ...
- [CSS3] Identify Interactive HTML Elements with CSS Link Pseudo Classes
The interactive pseudo-classes for links (and buttons) allow us to make sure the user knows what ele ...
- Oracle RAC cache fusion原理測试
Oracle RAC cache fusion是RAC最核心的工作机制.他把全部实例的SGA虚拟成一个大的SGA区,每当不同的实例请求同样的数据块,这个数据块就须要在实例间进行传递. 那究竟什么时候传 ...
- [WF4.0 实战] 事件驱动应用
看到题目或许非常多人都会疑问,为什么要使用事件监听呢? 眼下的认识: 1,使用事件监听能够将工作流的结点返回值返回到client 2,能够实现等待与重新启动,相当于之前的WaitActivity创建B ...
- 混合minxins
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Arcgis Engine(ae)接口详解(3):featureClass的feature编辑和删除
//由于测试数据不完善,featureClass在此要只设null值,真实功能要设实际的值 IFeatureClass featureClass = null; //获取某个字段的索引,后面取字段值用 ...
- npm ERR! code EINTEGRITY npm ERR! sha1- 报错解决办法
npm ERR! code EINTEGRITY npm ERR! sha1- 报错日志 npm ERR! code EINTEGRITY npm ERR! sha1-OGchPo3Xm/Ho8jAM ...
- python day 13 生成器 以及 推导式
1.生成器的本质是迭代器 2.生成器函数 def fn() 函数体 yield fn() g = fn() 此时这个g就是生成器 所以g 是可迭代的 g._ _next_ _ 每执行一次_ _nex ...
- 报错:out of memory java heap space
PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决 ...
- Linux 常用命令 (备忘)
查看linux版本信息 uname -r cat /proc/version