codeforces——703A——Mishka and Game
来源:互联网 发布:vb无印汉化 编辑:程序博客网 时间:2024/06/05 00:34
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 to6 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 nn (1 ≤ n ≤ 100) — the number of game rounds.
The next n lines contains rounds description.i-th of them contains pair of integersmi andci (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.
掷骰子比大小,问谁大比分领先。
#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 -1e9using 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
- 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(水)
- 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(玩骰子游戏,水题)
- 【打CF,学算法——二星级】Codeforces 703B Mishka and trip (统计)
- 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
- mac/linux 修改vim显示信息
- 微软发布可变形卷积网络代码:可用于多种复杂视觉任务
- windows netcdf vs 配置
- gcc与g++的认识
- Android应用程序常见编译问题解决
- codeforces——703A——Mishka and Game
- 简易分页组件
- 三分钟明白 Activity工作流 -- java运用
- 嵌入式 BootLoader 技术内幕
- 总要向前看
- mysql 根据 某个字段 把一行数据拆成多行
- android应用热修复与插件化实践之路
- 【面试题】剑指offer10--求一个数的二进制数中的1的个数
- 移动端的按钮手上去的提示效果