题目链接:http://codeforces.com/problemset/problem/703/A

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

Copy
3
3 5
2 1
4 2
output

Copy
Mishka
input

Copy
2
6 1
1 6
output

Copy
Friendship is magic!^^
input

Copy
3
1 5
3 3
2 2
output

Copy
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.

简单模拟一下,每次输入谁的分高谁赢,最后比较总的结果

AC代码如下:

 #include <iostream>
using namespace std;
int main()
{
int n,a,b;
cin>>n;
int ans1 = , ans2 = ;
while(n--)
{
cin>>a>>b;
if(a > b)
ans1++;
else if(a < b)
ans2++;
}
if(ans1 > ans2)
cout<<"Mishka"<<endl;
else if(ans1 < ans2)
cout<<"Chris"<<endl;
else
cout<<"Friendship is magic!^^"<<endl;
return ;
}

cf--703--A-- Mishka and Game的更多相关文章

  1. CF #365 703D. Mishka and Interesting sum

    题目描述 D. Mishka and Interesting sum的意思就是给出一个数组,以及若干询问,每次询问某个区间[L, R]之间所有出现过偶数次的数字的异或和. 这个东西乍看很像是经典问题, ...

  2. CF #365 (Div. 2) D - Mishka and Interesting sum 离线树状数组

    题目链接:CF #365 (Div. 2) D - Mishka and Interesting sum 题意:给出n个数和m个询问,(1 ≤ n, m ≤ 1 000 000) ,问在每个区间里所有 ...

  3. CF #365 (Div. 2) D - Mishka and Interesting sum 离线树状数组(转)

    转载自:http://www.cnblogs.com/icode-girl/p/5744409.html 题目链接:CF #365 (Div. 2) D - Mishka and Interestin ...

  4. cf B. Mishka and trip (数学)

    题意   Mishka想要去一个国家旅行,这个国家共有个城市,城市通过道路形成一个环,即第i个城市和第个城市之间有一条道路,此外城市和之间有一条道路.这个城市中有个首中心城市,中心城市与每个城市(除了 ...

  5. CF A.Mishka and Contest【双指针/模拟】

    [链接]:CF/4892 [题意]: 一个人解决n个问题,这个问题的值比k小, 每次只能解决最左边的或者最右边的问题 解决了就消失了.问这个人能解决多少个问题. [代码]: #include<b ...

  6. CF #365 DIV2 D Mishka and Interesting sum 区间异或+线段树

    D. Mishka and Interesting sum time limit per test 3.5 seconds memory limit per test 256 megabytes in ...

  7. Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum 离线+线段树

    题目链接: http://codeforces.com/contest/703/problem/D D. Mishka and Interesting sum time limit per test ...

  8. 暑假练习赛 003 F Mishka and trip

    F - Mishka and trip Sample Output   Hint In the first sample test: In Peter's first test, there's on ...

  9. Codeforces 703B. Mishka and trip 模拟

    B. Mishka and trip time limit per test:1 second memory limit per test:256 megabytes input:standard i ...

随机推荐

  1. 洛谷P3572题解

    这道题实在是一道 毒瘤 题,太坑爹了.那个写 \(deque\) 的题解亲测只有80分,原因 不言而明 ,这道题居然 丧心病狂 到 卡STL . 好了,不吐槽了,进入正题 题目分析: 这是一道十分 简 ...

  2. Leetcode solution 227: Basic Calculator II

    Problem Statement Implement a basic calculator to evaluate a simple expression string. The expressio ...

  3. 08_代码块丶继承和final

    Day07笔记 课程内容 1.封装 2.静态 3.工具类 4.Arrays工具类 封装 概述 1.封装:隐藏事物的属性和实现细节,对外提供公共的访问方式 2.封装的好处: 隐藏了事物的实现细节 提高了 ...

  4. java并发编程(十一)----(JUC原子类)基本类型介绍

    上一节我们说到了基本原子类的简单介绍,这一节我们先来看一下基本类型: AtomicInteger, AtomicLong, AtomicBoolean.AtomicInteger和AtomicLong ...

  5. 转载 | textarea 在浏览器中固定大小和禁止拖动

    HTML 标签 textarea 在大部分浏览器中只要指定行(rows)和列(cols)属性,就可以规定 textarea 的尺寸,大小就不会改变,不过更好的办法是使用 CSS 的 height 和 ...

  6. Java网络编程 -- 网络协议

    OSI网络七层协议 为使不同计算机厂家的计算机能够互相通信,以便在更大的范围内建立计算机网络,有必要建立一个国际范围的网络体系结构标准.OSI网络七层协议就是在这个基础上制定出来的,其从最底层开始依次 ...

  7. S3C2440 移植最新5.2linux内核

    基于 移植uboot后. 1. 移植linux内核 1.1 下载源码 打开 https://www.kernel.org/ 直接肝最新的 5.2.8 下载完后,在ubuntu里解压备用. 1.2 搭建 ...

  8. Django上线部署之Apache

    环境: 1.Windows Server 2016 Datacenter 64位 2.SQL Server 2016 Enterprise 64位 3.Python 3.6.0 64位 4.admin ...

  9. 盘一盘 NIO (一)—— Buffer源码解析

    Buffer是个啥? Buffer 即缓冲区,用来暂存输入输出数据的区域.Buffer对象是一份固定数量的数据的容器,实质上是一个数组.但是一个缓冲区不仅仅是一个数组,缓冲区提供了对数据的结构化访问, ...

  10. 2019heox博客部署到coding该绕的坑-奥怪的小栈

    文章转载于:2019heox博客部署到coding该绕的坑-奥怪的小栈 这篇文章适用于初次部署和部署到github后想双线部署到coding的朋友们,我将带你们绕过一些我踏过的坑. 前言 我一开始没打 ...