zoukankan      html  css  js  c++  java
  • Codeforces Gym100952 A. Who is the winner? (2015 HIAST Collegiate Programming Contest)

    哈哈哈哈哈哈哈,最近一直在补题,改各种错误的代码,wa了20多遍,改到心态爆炸,改好之后,感觉世界都美好了(叉会腰~)。。。

     
    time limit per test
    1 second
    memory limit per test
    64 megabytes
    input
    standard input
    output
    standard output

    A big marathon is held on Al-Maza Road, Damascus. Runners came from all over the world to run all the way along the road in this big marathon day. The winner is the player who crosses the finish line first.

    The organizers write down finish line crossing time for each player. After the end of the marathon, they had a doubt between 2 possible winners named "Player1" and "Player2". They will give you the crossing time for those players and they want you to say who is the winner?

    Input

    First line contains number of test cases (1  ≤  T  ≤  100). Each of the next T lines represents one test case with 6 integers H1 M1 S1 H2 M2 S2. Where H1, M1, S1 represent Player1 crossing time (hours, minutes, seconds) and H2, M2, S2 represent Player2 crossing time (hours, minutes, seconds). You can assume that Player1 and Player2 crossing times are on the same day and they are represented in 24 hours format(0  ≤  H1,H2  ≤  23 and 0  ≤  M1,M2,S1,S2  ≤  59)

    H1, M1, S1, H2, M2 and S2 will be represented by exactly 2 digits (leading zeros if necessary).

    Output

    For each test case, you should print one line containing "Player1" if Player1 is the winner, "Player2" if Player2 is the winner or "Tie" if there is a tie.

    Examples
    Input
    3
    18 03 04 14 03 05
    09 45 33 12 03 01
    06 36 03 06 36 03
    Output
    Player2
    Player1
    Tie

     

    代码:

     1 #include<bits/stdc++.h>
     2 using namespace std;
     3 int main(){
     4     int n;
     5     int a,b,c,a1,b1,c1;
     6     while(~scanf("%d",&n)){
     7         while(n--){
     8         scanf("%d%d%d%d%d%d",&a,&b,&c,&a1,&b1,&c1);
     9         if(a>a1) {printf("Player2
    ");}
    10         else if(a<a1) {printf("Player1
    ");}
    11         else if(a==a1){
    12             if(b>b1){printf("Player2
    ");}
    13             else if(b<b1){printf("Player1
    ");}
    14             else if(b==b1){
    15                 if(c>c1){printf("Player2
    ");}
    16                 else if(c<c1){printf("Player1
    ");}
    17                 else printf("Tie
    ");
    18             }
    19         }
    20         }
    21     }
    22     return 0;
    23 }
     
     
  • 相关阅读:
    编译并使用Lua语言
    C#中使用DLL文件
    将Unity3D游戏移植到Android平台上
    Unity3D知识点
    清下书柜,工作书,旧书,正版书,个人学习过的书asp,net,delphi,java,flex,actionscript,vb...
    使用ABP打造SAAS系统(2)——前端框架选择
    使用ABP打造SAAS系统(1)——环境准备
    延迟实例单例模式注意点
    jvm指令解释i = i++ + i++ + i++ + ++i;等于多少
    MYSQL增加库表权限
  • 原文地址:https://www.cnblogs.com/ZERO-/p/7245901.html
Copyright © 2011-2022 走看看