2015 HIAST Collegiate Programming Contest A

Who is the winner?

题意:给出2个时间,分别是a,b到终点撞线的时间,输出谁赢了,如果平局输出Tie

思路:xjb写

AC代码:

#include "iostream"
#include "string.h"
#include "stack"
#include "queue"
#include "string"
#include "vector"
#include "set"
#include "map"
#include "algorithm"
#include "stdio.h"
#include "math.h"
#define ll long long
#define bug(x) cout<<x<<" "<<"UUUUU"<<endl;
#define mem(a) memset(a,0,sizeof(a))
#define mp(x,y) make_pair(x,y)
using namespace std;
const long long INF = 1e18+1LL;
const int inf = 1e9+1e8;
const int N=1e5+100;

///2015 HIAST Collegiate Programming Contest

///AAAA

int h1,h2,m1,m2,s1,s2;
int main(){
    int t;
    cin>>t;
    while(t--){
        cin>>h1>>m1>>s1>>h2>>m2>>s2;
        if(h1==h2){
            if(m1==m2){
                if(s1==s2){
                    cout<<"Tie"<<endl;
                    continue;
                }
                if(s1<s2){
                    cout<<"Player1"<<endl;
                    continue;
                }
                else{
                    cout<<"Player2"<<endl;
                    continue;
                }
            }
            if(m1<m2){
                cout<<"Player1"<<endl;
                continue;
            }
            else{
                cout<<"Player2"<<endl;
                continue;
            }

        }
        if(h1<h2){
            cout<<"Player1"<<endl;
            continue;
        }
        else{
            cout<<"Player2"<<endl;
            continue;
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/max88888888/p/7161647.html