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 }
  • 相关阅读:
    在SplendidCRM中添加用户控件
    SPendidCRM:给HK的ImageInfoEntryEditView增加一个checkbox,用于判断特殊类型的PODS记录
    html button 跳转ASP.NET页面跳转技术总结
    让<li>不显示超出内容,显示... (编程方法和CSS方法)
    SplendidCRM Popup.aspx的hyperlink字段配置的易错点
    asp.net 个别页面URL参数出现中文乱码的解决方法
    解决:工具箱里边没了Dev控件
    DevControlgridview的属性说明 (转)
    DevControlgridview的属性说明 (转)
    VM如何设置U盘启动
  • 原文地址:https://www.cnblogs.com/hsd-/p/5739766.html
Copyright © 2011-2022 走看看