zoukankan      html  css  js  c++  java
  • Codeforces Round #365 (Div. 2) A 水

    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.

    题意:输出获胜者

    题解:水

     1 /******************************
     2 code by drizzle
     3 blog: www.cnblogs.com/hsd-/
     4 ^ ^    ^ ^
     5  O      O
     6 ******************************/
     7 //#include<bits/stdc++.h>
     8 #include<iostream>
     9 #include<cstring>
    10 #include<cstdio>
    11 #include<map>
    12 #include<algorithm>
    13 #include<queue>
    14 #include<cmath>
    15 #define ll __int64
    16 #define PI acos(-1.0)
    17 #define mod 1000000007
    18 using namespace std;
    19 int n;
    20 int main()
    21 {
    22     scanf("%d",&n);
    23     int l=0,r=0;
    24     int a,b;
    25     for(int i=1;i<=n;i++)
    26     {
    27         scanf("%d %d",&a,&b);
    28         if(a>b)
    29             l++;
    30         if(b>a)
    31             r++;
    32     }
    33     if(l>r)
    34     cout<<"Mishka"<<endl;
    35     if(l<r)
    36     cout<<"Chris"<<endl;
    37     if(l==r)
    38     cout<<"Friendship is magic!^^"<<endl;
    39     return 0;
    40 }
  • 相关阅读:
    C# 注册表操作类
    NVelocity for AS“.NET研究”P.NET MVC 狼人:
    C#4.0新特性&quot;协变&quot;“.NET研究”与&quot;逆变&quot;以及背后的编程思想 狼人:
    原创“.NET研究”企业级控件库之图片浏览控件 狼人:
    “.NET研究”关于C# 中的Attribute 特性 狼人:
    如何让ASP.NET默认的资源编程“.NET研究”方式支持非.ResX资源存储 狼人:
    使用 “.NET研究”IIS Express 取代 ASP.NET Development Server 狼人:
    云计算从基础到应用架“.NET研究”构系列云计算的演进 狼人:
    通过自定义配置实现插“.NET研究”件式设计 狼人:
    ASP.NET MVC 3 概述“.NET研究” 狼人:
  • 原文地址:https://www.cnblogs.com/hsd-/p/5739766.html
Copyright © 2011-2022 走看看