CodeForces 703A Mishka and Game
2016-08-11 11:20
519 查看
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
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 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 Chris.
水题:给出每场比赛的得分,判断谁输,谁赢
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int main() { int n,a,b,M,C; while(scanf("%d",&n)!=EOF) { M=0; C=0; while(n--) { scanf("%d%d",&a,&b); if(a>b) M++; else if(a<b) C++; } if(M==C) printf("Friendship is magic!^^\n"); else if(M>C) printf("Mishka\n"); else printf("Chris\n"); } return 0; }
相关文章推荐
- CodeForces 703A Mishka and Game
- 【Codeforces】-703A-Mishka and Game(水)
- codeforces - 703A - 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 703 A. Mishka and Game (水)
- 【codeforces 703 D】【离线询问 树状数组 前驱思想 前缀异或和】D. Mishka and Interesting sum【 区间内出现次数偶数的数的异或和】
- codeforces 850C Arpa and a game with Mojtaba(博弈,bitmask)
- 【CODEFORCES】 B. Appleman and Card Game
- Codeforces---Fox and Card Game
- Codeforces 703D Mishka and Interesting sum (树状数组求区间内不同的数的异或和)
- CodeForces 703D Mishka and Interesting sum
- 【codeforces 546D】Soldier and Number Game
- codeforces 842 A. Kirill And The Game(阅读题)
- codeforces 389A(Fox and Number Game) 简单的欧几里德算法 Java
- (模拟+数学)codeforces - 703B Mishka and trip
- Codeforces 703D Mishka and Interesting sum 树状数组