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 }

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

  • 相关阅读:
    终于有人把MYSQL索引讲清楚了
    计算机基础知识总结与操作系统 PDF 下载
    java电子书python电子书等PDF下载方式
    redis布隆过滤器
    IntelliJ IDEA 2020.1 激活教程,亲测可用
    Another Redis DeskTop Manager一款稳定全新的redis连接工具
    一文吃透redis持久化,妈妈再也不担心我面试过不了!
    ES6 运算符
    If-Else的5种方法从入门到高级示例
    ES6中 的类(class)
  • 原文地址:https://www.cnblogs.com/Kiven5197/p/5740309.html
Copyright © 2011-2022 走看看