zoukankan      html  css  js  c++  java
  • A. Mishka and Game

    time limit per test
    1 second
    memory limit per test
    256 megabytes
    input
    standard input
    output
    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!

    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
    3
    3 5
    2 1
    4 2
    output
    Mishka
    input
    2
    6 1
    1 6
    output
    Friendship is magic!^^
    input
    3
    1 5
    3 3
    2 2
    output
    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.

    A题居然这么水!!昨晚cf挤爆好不容易刷进去发现A题就是一道比较大小??!居然还到了七分钟才交TAT。

    水AC代码:

     1 #include<iostream>
     2 #include<cstdio>
     3 #include<cstring>
     4 #include<algorithm>
     5 #include<cmath>
     6 using namespace std;
     7 
     8 int main(){
     9     int n,b,c;
    10     cin>>n;
    11     int x=0,y=0;
    12     while(n--){
    13         cin>>b>>c;
    14         if(b>c)
    15         x++;
    16         if(b<c)
    17         y++;
    18     }
    19     if(x>y){
    20         cout<<"Mishka";
    21     }
    22     if(y>x){
    23         cout<<"Chris";
    24     }
    25     if(x==y){
    26         cout<<"Friendship is magic!^^";
    27     }
    28     return 0;
    29 }

    说实话这种题贴出来就是为了凑篇幅啊 嘛..用来掩盖我好些天偷懒没更博客的事实【雾!

  • 相关阅读:
    年度榜单:2013年最流行的15款免费英文字体
    优秀案例:12个精美的设计工作室 & 设计公司网站
    jQuery Label Better – 友好的表单输入框提示插件
    CSS 魔法系列:纯 CSS 绘制各种图形《系列六》
    Feathers JS – 基于 Express 构建数据驱动的服务
    Node.app – 用于 iOS App 开发的 Node.js 解释器
    100款免费的圣诞节矢量图标素材(PSD & SVG)
    Web 开发人员不能错过的 jQuery 教程和案例
    Headroom.js – 快速响应用户的页面滚动操作
    10个实用的 CSS3 按钮效果制作教程
  • 原文地址:https://www.cnblogs.com/Kiven5197/p/5740309.html
Copyright © 2011-2022 走看看