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 }
  • 相关阅读:
    SVG <–> XAML
    Visual Studio 2005 下 ASP.net Web Service SOAP XML 节点的疑惑
    IE 和 Chrome 不能上网,Windows Live Mail 不能发邮件。Firefox可用。解决办法
    c# FileStream和StreamWriter用法
    c# 壓縮與解壓的簡單學習
    c# 文件輸入和輸出主要類說明
    部署Web應用程序
    allowDefinition='MachineToApplication' 错误的解决办法
    Global.asax的16个事件处理过程
    c# 類模板加上自定義內容
  • 原文地址:https://www.cnblogs.com/hsd-/p/5739766.html
Copyright © 2011-2022 走看看