Codeforces Round #365 (Div. 2) A 水
1 second
256 megabytes
standard input
standard output
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.
- 3
3 5
2 1
4 2
- Mishka
- 2
6 1
1 6
- Friendship is magic!^^
- 3
1 5
3 3
2 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.
题意:输出获胜者
题解:水
- /******************************
- code by drizzle
- blog: www.cnblogs.com/hsd-/
- ^ ^ ^ ^
- O O
- ******************************/
- //#include<bits/stdc++.h>
- #include<iostream>
- #include<cstring>
- #include<cstdio>
- #include<map>
- #include<algorithm>
- #include<queue>
- #include<cmath>
- #define ll __int64
- #define PI acos(-1.0)
- #define mod 1000000007
- using namespace std;
- int n;
- int main()
- {
- scanf("%d",&n);
- int l=,r=;
- int a,b;
- for(int i=;i<=n;i++)
- {
- scanf("%d %d",&a,&b);
- if(a>b)
- l++;
- if(b>a)
- r++;
- }
- if(l>r)
- cout<<"Mishka"<<endl;
- if(l<r)
- cout<<"Chris"<<endl;
- if(l==r)
- cout<<"Friendship is magic!^^"<<endl;
- return ;
- }
Codeforces Round #365 (Div. 2) A 水的更多相关文章
- Codeforces Round #365 (Div. 2) C - Chris and Road 二分找切点
// Codeforces Round #365 (Div. 2) // C - Chris and Road 二分找切点 // 题意:给你一个凸边行,凸边行有个初始的速度往左走,人有最大速度,可以停 ...
- Codeforces Round #365 (Div. 2)
A题 Mishka and Game 水..随便统计一下就A了 #include <cstdio> #include <map> #include <set> #i ...
- Mishka and Divisors[CodeForces Round #365 Div.2]
http://codeforces.com/contest/703/problem/E 题意:给定一个最多个数的序列,从中选出最少个数的数字,使得他们的乘积是k的倍数,若有多种选择方式,输出选出数字和 ...
- Codeforces Round #365 (Div. 2)-D Mishka and Interesting sum(树状数组)
题目链接:http://codeforces.com/contest/703/problem/D 思路:看了神犇的代码写的... 偶数个相同的数异或结果为0,所以区间ans[l , r]=区间[l , ...
- 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 ...
- Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum (离线树状数组+前缀xor)
题目链接:http://codeforces.com/contest/703/problem/D 给你n个数,m次查询,每次查询问你l到r之间出现偶数次的数字xor和是多少. 我们可以先预处理前缀和X ...
- Codeforces Round #404 (Div. 2)(A.水,暴力,B,排序,贪心)
A. Anton and Polyhedrons time limit per test:2 seconds memory limit per test:256 megabytes input:sta ...
- Codeforces Round #408 (Div. 2)(A.水,B,模拟)
A. Buying A House time limit per test:2 seconds memory limit per test:256 megabytes input:standard i ...
- Codeforces Round #365 (Div. 2) E - Mishka and Divisors(转化成01-背包)
http://codeforces.com/contest/703/problem/E 题意: 给出n个数和一个k,计算出至少要多少个数相乘才是k的倍数. 思路:这道题目参考了杭电大神的代码http: ...
随机推荐
- FLASH AS 不显示中文
我修改一个as游戏,发现公告显示不了,整整折腾了2天. flash TextField 汉字不显示,英文会显示,如果是汉字夹杂数字,只把数字显示了,汉字被忽略了. 有人说嵌入字体,网上一搜索,好麻 ...
- 前端相关技术之ajax相关
AJAX技术点 async javascript and xml:异步的js和xml,用js异步去操作xml ajax用于数据交互,不能操作DOM –节省用户操作,时间,提高用户体验,减少数据请求 – ...
- php头像上传并裁剪支持3个尺寸
源码下载
- SelectedRows.CurrentRowSelected 和 DeleteItem
procedure TBMListEh.SetCurrentRowSelected(Value: Boolean); var Index: Integer; Current: TUniBookmark ...
- struts中的常量,action配置中的默认值
1.struts中Action的开发方式 继承ActionSupport类,这种方法实现的Action可以进行数据校验: 实现Action接口: 不继承任何类,不实现任何接口: 是否继承类或实现接口, ...
- java jdbc----mysql的select、insert、update、delete
//-----------------------------------select---------------------------------- import java.sql.Connec ...
- Android TextView多行垂直滚动
在Android应用中,有时候需要TextView可以垂直滚动,今天我就介绍一下怎么实现的.在布局里: <TextView android:id="@+id/tvCWJ" a ...
- 黑马程序员——C语言基础语法 关键字 标识符 注释 数据及数据类型
Java培训.Android培训.iOS培训..Net培训.期待与您交流! (一下内容是对黑马苹果入学视频的个人知识点总结) (一)C语言简单介绍 (1)C语言程序是由函数组成的任何C语言程序都是由一 ...
- 纯手写分页控件CSS+JS+SQL
Asp.net中虽然用DataPager配合ListView可以实现分页显示,但是有时候由于开发环境等问题不能用到DataPager控件,那么自己手工写一个分页控件就很有必要了,当然,最重要的是通用性 ...
- 在android中使用achartengine来绘制各种图表
可以绘制线性图,点状图,柱状图,饼状图,气泡图等 1. [文件] ABarChart.java ~ 2KB 下载(231) ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...