Codeforces Round #365 (Div. 2) A. Mishka and Game
来源:互联网 发布:手机上编程 编辑:程序博客网 时间:2024/05/17 01:38
A. Mishka and Game
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard 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!
Input
The 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.
Output
If 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.
Examples
Input
3
3 5
2 1
4 2
Output
Mishka
Input
2
6 1
1 6
Output
Friendship is magic!^^
Input
3
1 5
3 3
2 2
Output
Chris
Note
In 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 Ch
题意:两个人玩游戏,进行n次游戏,每个人说一个数,谁大谁赢,问最后谁赢的次数多
ac代码:
/* ***********************************************Author : AnICoo1Created Time : 2016-08-06-11.14 SaturdayFile Name : D:\MyCode\2016-8月\2016-8-6.cppLANGUAGE : C++Copyright 2016 clh All Rights Reserved************************************************ */#include<stdio.h>#include<math.h>#include<string.h>#include<stack>#include<set>#include<map>#include<queue>#include<vector>#include<iostream>#include<algorithm>#define MAXN 1010000#define LL long long#define ll __int64#define INF 0xfffffff#define mem(x) memset(x,0,sizeof(x))#define PI acos(-1)#define eps 1e-8using namespace std;ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}ll lcm(ll a,ll b){return a/gcd(a,b)*b;}ll powmod(ll a,ll b,ll MOD){ll ans=1;while(b){if(b%2)ans=ans*a%MOD;a=a*a%MOD;b/=2;}return ans;}double dpow(double a,ll b){double ans=1.0;while(b){if(b%2)ans=ans*a;a=a*a;b/=2;}return ans;}//headint main(){ int n;cin>>n;int cnta=0,cntb=0; for(int i=0;i<n;i++) { int a,b;cin>>a>>b; if(a>b) cnta++; else if(a<b) cntb++; } if(cnta>cntb) cout<<"Mishka"<<endl; else if(cnta<cntb) cout<<"Chris"<<endl; else cout<<"Friendship is magic!^^"<<endl; return 0;}
- 【Codeforces Round 365 (Div 2)A】【水题】Mishka and Game
- Codeforces Round #365 (Div. 2) A. Mishka and Game
- Codeforces Round #365 (Div. 2) -- A. Mishka and Game (水题)
- Codeforces 365(Div.2)A.Mishka and Game【水题】
- Codeforces Round #365 (Div. 2)D. Mishka and Interesting sum
- Codeforces Round #365 (Div. 2) Mishka and trip
- Codeforces Round #365 (Div. 2) B. Mishka and trip
- Codeforces Round #365 (Div. 2) Mishka and trip
- Codeforces Round #365 (Div. 2) -- B. Mishka and trip
- Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum
- Codeforces Round #365 (Div. 2) [B] Mishka and trip
- Codeforces Round #365 (Div. 2)D - Mishka and Interesting sum
- Codeforces Round #365 (Div. 2)Mishka and Divisors 题解。 DP
- Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum
- Codeforces Round #365 (Div. 2) B. Mishka and trip
- Codeforces Round #365 (Div. 2) B. Mishka and trip
- Codeforces Round #365 (Div. 2) [D] Mishka and Interesting sum
- Codeforces Round #365 (Div. 2) Mishka and trip
- C51数据类型扩充定义
- Android手机获取GPS卫星数量问题
- POJ 2624 4th Point
- Unity学习笔记 1st —— 物体会移动就是游戏的开始!
- 51单片机 数码管的显示与译码器
- Codeforces Round #365 (Div. 2) A. Mishka and Game
- android项目解刨之时间轴
- C#入门6.10——字符串的删除
- NSURLSession和NSURLConnection 的区别
- 动态上下线datanode节点及副本均衡机制
- 数据结构与算法的Java描述--1
- 51单片机 按键,键盘检测
- iOS里面的UIActivityIndicatorView类,简称菊花
- 说说 HTML 中的dropEffect 和 effectAllowed