码迷,mamicode.com
首页 > Windows程序 > 详细

Gym 100952 A. Who is the winner?

时间:2017-07-18 11:43:29      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:hose   test   file   oss   standard   number   set   spec   necessary   

A. Who is the winner?
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
水题;
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
    int a,b,c,x,y,z,n;
    cin>>n;
    while(n--)
    {
        cin>>a>>b>>c>>x>>y>>z;
        int ans=a*60*60+b*60+c;
        int pos=x*60*60+y*60+z;
        if(ans>pos) puts("Player2");
        else if(ans<pos) puts("Player1");
        else puts("Tie");
    }
}

 

Gym 100952 A. Who is the winner?

标签:hose   test   file   oss   standard   number   set   spec   necessary   

原文地址:http://www.cnblogs.com/shinianhuanniyijuhaojiubujian/p/7199094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!