【Codeforces】-703A-Mishka and Game(水)
来源:互联网 发布:在淘宝开店快递怎么弄 编辑:程序博客网 时间:2024/06/04 17:56
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!
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.
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.
33 52 14 2
Mishka
26 11 6
Friendship is magic!^^
31 53 32 2
Chris
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 Chr
水!
#include<cstdio>#include<cstring>#include<queue>#include<stack>#include<algorithm>using namespace std;#define CLR(a,b) memset(a,b,sizeof(a))int main(){int n;while(~scanf("%d",&n)){int num1=0,num2=0;for(int i=1;i<=n;i++){int a,b;scanf("%d %d",&a,&b);if(a>b)num1++;if(a<b)num2++;}if(num1==num2)printf("Friendship is magic!^^\n");else if(num1>num2)printf("Mishka\n");elseprintf("Chris\n");}return 0;}
- 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——703A——Mishka and Game
- Codeforces 365(Div.2)A.Mishka and Game【水题】
- CodeForces 703A Mishka and Game(玩骰子游戏,水题)
- A. Mishka and Game
- 【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 - 703B Mishka and trip
- codeforces 703B Mishka and trip
- CodeForces 703D Mishka and Interesting sum
- 【Codeforces 703B - Mishka and trip】
- Codeforces-703B Mishka and trip
- Codeforces-703D Mishka and Interesting sum
- 常见排序算法总结-C++实现
- Palindrome Partitioning学习
- 数据结构上机测试1:顺序表的应用
- GET请求和POST请求
- 《Thinking in Java》学习笔记-----第2章 一切都是对象
- 【Codeforces】-703A-Mishka and Game(水)
- linux安装redis
- UNITY 5.4.0发行说明中文版(不包含bug修正部分)
- 青海湖旅行总结
- java.lang.IllegalArgumentException: An invalid domain [.test.com] was specified for this cookie
- laravel操作给手机发送短信
- 消息栏通知(Notification)介绍
- Android阶段学习笔记 16.8.6 之 SharedPreferences存数据
- Linux环境常用命令