codeforces 703 A. Mishka and Game (水)
来源:互联网 发布:淘宝快递多久自动售货 编辑:程序博客网 时间:2024/06/05 09:12
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 Chris.
累了水水题,
n组x y,x>y,前者赢一局;x<y,后者赢一局,x==y,平
#include<cstdio>int main(){int n,a,b,s1,s2;scanf("%d",&n);s1=s2=0;for(int i=0;i<n;i++){scanf("%d%d",&a,&b);if(a>b)s1++;if(b>a)s2++;elsecontinue;}if(s1>s2)printf("Mishka\n");else if(s1<s2)printf("Chris\n");elseprintf("Friendship is magic!^^\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
- A. Mishka and Game
- Codeforces 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 703A Mishka and Game(玩骰子游戏,水题)
- Codeforces Round #365 (Div. 2) -- A. Mishka and Game (水题)
- 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
- CodeForces 703B Mishka and trip(图论)
- SQL SERVER 常用函数,很实用,查询短期内的记录,按照访问次数查询
- mySql 常用命令及语法
- 序列化与反序列化
- 苹果iPhone 7要来了 手里的旧6/6s怎么处理最划算
- oracle中拼接sql过长的解决方法
- codeforces 703 A. Mishka and Game (水)
- JavaScript DOM操作记录
- 浅谈 Swift 柯里化(Currying)
- bzoj 4565: [Haoi2016]字符合并 (字符串dp)
- OC_11_2协议
- java监听器
- Robotium学习(六)-运行错误的解决方法
- Ext JS Data Package
- TESTNG组测试