Gym 100952A&&2015 HIAST Collegiate Programming Contest A. Who is the winner?【字符串,暴力】
A. Who is the winner?
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?
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).
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.
3
18 03 04 14 03 05
09 45 33 12 03 01
06 36 03 06 36 03
Player2
Player1
Tie
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline int read()
{
int x=,f=;
char ch=getchar();
while(ch<''||ch>'')
{
if(ch=='-')
f=-;
ch=getchar();
}
while(ch>=''&&ch<='')
{
x=x*+ch-'';
ch=getchar();
}
return x*f;
}
inline void write(int x)
{
if(x<)
{
putchar('-');
x=-x;
}
if(x>)
{
write(x/);
}
putchar(x%+'');
}
int a[],b[];
int n;
int main()
{
n=read();
while(n--)
{
//cin.getline(s1,8);
//cin.getline(s2,8);
for(int i=;i<;i++)
a[i]=read();
for(int i=;i<;i++)
b[i]=read();
int flag=-;
for(int i=;i<;i++)
{
if(a[i]>b[i])
{
flag=;
break;
}
else if(a[i]<b[i])
{
flag=;
break;
}
else continue;
}
if(flag==)
printf("Player2\n");
else if(flag==)
printf("Player1\n");
else printf("Tie\n");
}
return ;
}
Gym 100952A&&2015 HIAST Collegiate Programming Contest A. Who is the winner?【字符串,暴力】的更多相关文章
- Gym 100952E&&2015 HIAST Collegiate Programming Contest E. Arrange Teams【DFS+剪枝】
E. Arrange Teams time limit per test:2 seconds memory limit per test:64 megabytes input:standard inp ...
- Gym 100952F&&2015 HIAST Collegiate Programming Contest F. Contestants Ranking【BFS+STL乱搞(map+vector)+优先队列】
F. Contestants Ranking time limit per test:1 second memory limit per test:24 megabytes input:standar ...
- Gym 100952J&&2015 HIAST Collegiate Programming Contest J. Polygons Intersection【计算几何求解两个凸多边形的相交面积板子题】
J. Polygons Intersection time limit per test:2 seconds memory limit per test:64 megabytes input:stan ...
- Gym 100952I&&2015 HIAST Collegiate Programming Contest I. Mancala【模拟】
I. Mancala time limit per test:3 seconds memory limit per test:256 megabytes input:standard input ou ...
- Gym 100952H&&2015 HIAST Collegiate Programming Contest H. Special Palindrome【dp预处理+矩阵快速幂/打表解法】
H. Special Palindrome time limit per test:1 second memory limit per test:64 megabytes input:standard ...
- Gym 100952G&&2015 HIAST Collegiate Programming Contest G. The jar of divisors【简单博弈】
G. The jar of divisors time limit per test:2 seconds memory limit per test:64 megabytes input:standa ...
- Gym 100952D&&2015 HIAST Collegiate Programming Contest D. Time to go back【杨辉三角预处理,组合数,dp】
D. Time to go back time limit per test:1 second memory limit per test:256 megabytes input:standard i ...
- Gym 100952C&&2015 HIAST Collegiate Programming Contest C. Palindrome Again !!【字符串,模拟】
C. Palindrome Again !! time limit per test:1 second memory limit per test:64 megabytes input:standar ...
- Gym 100952B&&2015 HIAST Collegiate Programming Contest B. New Job【模拟】
B. New Job time limit per test:1 second memory limit per test:64 megabytes input:standard input outp ...
随机推荐
- iOS MJRefresh下拉、上拉刷新自定义以及系统详细讲解
更新: MJRefresh 更新功能,默认根据数据来源 自动显示 隐藏footer,这个功能可以关闭 DoctorTableView.mj_footer.automaticallyHidden = N ...
- iView的使用【CDN向】
直接粗暴地上html代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- [UWP]了解IValueConverter
1. 前言 IValueConverter是用于数据绑定的强大的武器,它用于Value在Binding Source和Binding Target之间的转换.本文将介绍IValueConverter的 ...
- CSS3 使用选择器在页面插入内容
使用选择器来插入文字 h2:before{ content:'COLUMN'; color:white: background-color:orange: padding:1px 5px; } 注意点 ...
- Xamarin 调用JSON.net来解析JSON 转(Model) json2csharp.com/
https://www.cnblogs.com/zjoch/p/4458516.html 再来我们要怎么解析JSON格示呢?在.net 中,我们很孰悉的JSON.net,没错,我们依然可以在Xam ...
- python的sorted函数
sorted很简单,没太多好写的 ,只是给自己做个笔记. sorted接受三个参数,返回一个排序之后的list. 第一个接受一个可迭代的对象(因为sorted实现了迭代协议,所以接受的参数不一定需要l ...
- com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector APPARENT DEADLOCK
最近在IDEA中启动Tomcat经常会碰到这个错误,起初.一直没在意,现在碰到的次数多了,就去查看下这个问题,现描述如下: =2018-01-08 14:27:30,216 WARN [com.mch ...
- [js高手之路]html5 canvas动画教程 - 边界判断与反弹
备注:本文后面的代码,如果加载了ball.js,那么请使用这篇文章[js高手之路] html5 canvas动画教程 - 匀速运动的ball.js代码. 边界反弹: 当小球碰到canvas的四个方向的 ...
- Hibernate学习笔记(6)---Criteria接口
Criteria接口 Criteria查询通过面相对向的设计,将数据查询条件封装为一个对象.在hibernate执行时会把criteria指定的查询恢复相应的sql语句. 条件查询 Criteria ...
- Jenkins:基于linux构建ivy项目
Jenkins:基于linux构建ivy项目 (二) 基于以上<Jenkins:VMware虚拟机Linux系统的详细安装和使用教程(一)>的配置再进行对ivy项目构建: 启动tomcat ...