Coderforces #365 Mishka and Game
2016-08-11 16:20
337 查看
Mishka and Game
Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u
Submit Status Practice CodeForces
703A
Appoint description:
System Crawler (Aug 5, 2016 10:58:57 AM)
Description
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.
Sample Input
Input
Output
Input
Output
Input
Output
Hint
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:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u
Submit Status Practice CodeForces
703A
Appoint description:
System Crawler (Aug 5, 2016 10:58:57 AM)
Description
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.
Sample Input
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
Hint
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.
很简单,不多说,,,,,
代码:
<pre name="code" class="cpp">#include<stdio.h> #include<string.h> int main() { int n; while(scanf("%d",&n)!=EOF) { int ans1=0,ans2=0; while(n--) { int a,b; scanf("%d%d",&a,&b); if(a>b) { ans1++; } else if(a<b) { ans2++; } } if(ans1>ans2) { printf("Mishka\n"); } else if(ans1<ans2) { printf("Chris\n"); } else { printf("Friendship is magic!^^\n"); } } return 0; }
相关文章推荐
- Codeforces 365(Div.2)A.Mishka and Game【水题】
- codeforces - 703A - Mishka and Game(水)
- Codeforces-703A-Mishka and Game
- Codeforces 703A. Mishka and Game
- codeforces 703 A. Mishka and Game (水)
- CodeForces 703A Mishka and Game(模拟)
- cf703A 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(水)
- CF Bear and Game
- 文章标题 Coderforces 755B : PolandBall and Game(水)
- Video Game Spaces: Image, Play, and Structure in 3D Worlds
- [siggraph10]color enhancement and rendering in film and game productio
- A Tutorial on Pointers and Arrays in C - General Programming - Articles - Articles - GameDev.net
- Codeforces Round #365 (Div. 2) D.Mishka and Interesting sum (树状数组维护异或值) ★ ★
- Arya and Bran & Game of the Rows & Multiple Clocks
- CF389A:Fox and Number Game(简单数论)