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 }
  • 相关阅读:
    平面几何-9 (海边直播目标2017全国初中数学竞赛班第14周作业题)
    数学奥林匹克问题解答:平面几何-8
    数学奥林匹克问题解答:平面几何-7
    lazyload懒加载插件
    Vue的生命周期
    用Vue来实现音乐播放器(九):歌单数据接口分析
    axios的详细用法以及后端接口代理
    用Vue来实现音乐播放器(八):自动轮播图啊
    Vue实现音乐播放器(七):轮播图组件(二)
    Vue实现音乐播放器(六):jsonp的应用+抓取轮播图数据
  • 原文地址:https://www.cnblogs.com/hsd-/p/5739766.html
Copyright © 2011-2022 走看看