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 }
  • 相关阅读:
    bzoj 1069 凸包+旋转卡壳
    bzoj 3203 凸包+三分
    bzoj 3779 重组病毒 好题 LCT+dfn序+线段树分类讨论
    bzoj 3881 [Coci2015]Divljak fail树+树链的并
    bzoj 4034 [HAOI2015]树上操作 入栈出栈序+线段树 / 树剖 维护到根距离和
    bzoj 2819 Nim dfn序+树状数组维护区间异或值
    bzoj 4031 [HEOI2015]小Z的房间 Matrix-tree定理
    BZOJ3676: [Apio2014]回文串
    BZOJ2434: [Noi2011]阿狸的打字机
    BZOJ2553: [BeiJing2011]禁忌
  • 原文地址:https://www.cnblogs.com/hsd-/p/5739766.html
Copyright © 2011-2022 走看看