codeforces——703A——Mishka and Game
2017-06-14 18:03
169 查看
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 from1 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 nn (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
Output
Input
Output
Input
Output
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 Chris.
掷骰子比大小,问谁大比分领先。
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 from1 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 nn (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 4000 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 Chris.
掷骰子比大小,问谁大比分领先。
#include <iostream> #include <deque> #include <cstring> #include <algorithm> #include <stdio.h> #include <map> #include <vector> #include <iomanip> #include <string> #include <cstring> #include <functional> #include <queue> #define MIN -1e9 using namespace std; int main() { int n; while(cin>>n) { int p1=0,p2=0; while(n--) { int P1,P2; cin>>P1>>P2; p1+=(P1>P2); p2+=(P2>P1); } if(p1>p2) cout<<"Mishka"<<endl; else if(p1<p2) cout<<"Chris"<<endl; else cout<<"Friendship is magic!^^"<<endl; } return 0; }
相关文章推荐
- CodeForces 703A Mishka and Game(模拟)
- cf703A Mishka and Game
- codeforces 703 A. Mishka and Game (水)
- CodeForces 703A Mishka and Game
- CodeForces 703A Mishka and Game(玩骰子游戏,水题)
- 【Codeforces】-703A-Mishka and Game(水)
- CodeForces 703A Mishka and Game
- Codeforces 365(Div.2)A.Mishka and Game【水题】
- Codeforces-703A-Mishka and Game
- codeforces - 703A - Mishka and Game(水)
- Codeforces 703A. Mishka and Game
- Coderforces #365 Mishka and Game
- Codeforces Round #365 (Div. 2) B. Mishka and trip
- Codeforces_388C_Fox and Card Game(博弈、贪心、排序)
- 树状数组【CF703D】Mishka and Interesting sum
- AlphaGo论文的译文,用深度神经网络和树搜索征服围棋:Mastering the game of Go with deep neural networks and tree search
- Building a WPF Sudoku Game: Part 3 - Adding Polish and Customizing Controls (zz)
- codeforces 811D——Vladik and Favorite Game(bfs)
- Building a WPF Sudoku Game: Part 5 - The AI Battle: Loading and Comparing AI Plug-ins
- [hdu 5945 Fxx and game] dp+单调队列