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 }

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

  • 相关阅读:
    工作计划
    bzoj3626:[LNOI2014]LCA
    bzoj3631:[JLOI2014]松鼠的新家
    bzoj3573: [Hnoi2014]米特运输
    bzoj4027,[HEOI2015]兔子与樱花
    bzoj3624,[Apio2008]免费道路
    bzoj2208连通数
    tyvj1153/洛谷P1262间谍网络
    Application server libraries not found && IntelliJ IDEA && tomcat
    debian9安装java8
  • 原文地址:https://www.cnblogs.com/Kiven5197/p/5740309.html
Copyright © 2011-2022 走看看