Advertisement
Hamoudi30

problem B

May 14th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. const int N = 200009;
  4. int main() {
  5.     ios_base::sync_with_stdio(false);
  6.     cin.tie(nullptr);
  7.     cout.tie(nullptr);
  8. //    freopen("/home/hamoudi/Coding/run.in", "r", stdin);
  9.     int tt = 1;
  10.     cin >> tt;
  11.     while (tt--) {
  12.         int h1, h2, m1, m2, s1, s2;
  13.         cin >> h1 >> m1 >> s1 >> h2 >> m2 >> s2;
  14. //        first we need to compare between starting hour
  15.         if(h1 > h2) {
  16.             cout << "Player2\n";
  17.         }
  18.         else if (h1 < h2) {
  19.             cout << "Player1\n";
  20.         } else {
  21. //        if they start at the same hour. so we need to check the starting minute
  22.             if (m1 > m2) {
  23.                 cout << "Player2\n";
  24.             } else if (m1 < m2) {
  25.                 cout << "Player1\n";
  26.             } else {
  27. //        if they start at the same minute. so we need to check the starting second
  28.                 if (s1 > s2) {
  29.                     cout << "Player2\n";
  30.                 } else if (s1 < s2) {
  31.                     cout << "Player1\n";
  32.                 } else {
  33.                     cout << "Tie\n";
  34.                 }
  35.             }
  36.         }
  37.     }
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement