/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 348.0 KiB
#2 Wrong Answer 19ms 580.0 KiB
#3 Wrong Answer 10ms 564.0 KiB

Code

/*
    1 2 3 4 5 6 7 8 9 10 11 
    5 6

    4 6
    3 6
    3 5
    3 4
    2 4
    1 4
    1 3
    1 3
    0 3

    4 6
    4 5
    4 4
    3 4
    2 4
    2 3
    2 2
    1 2
    0 2

    2 2 3 2 2 

    od = 1
    ev = 4

    1 4


*/

/* Solved by Sakhawat Hossain Mahin, CSE-28th, SMUCT */
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long

#define faf ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#define test  \
    int T;    \
    cin >> T; \
    while (T--)

const int N = 1e5 + 7;
int ar[N];

void crack()
{
    int n;
    cin>>n;
    int od = 0, ev = 0; 
    for(int i = 0; i < n; i++){
        int x;
        cin>>x;
        if(x % 2){
            od++;
        }
        else ev++;
    }
    od = od >= ev? od : ev;
    if(ev % 2){
        if(od == ev){
            cout << "Hridoy";
        }
        else cout << "Roy";
    }
    else{
        if(od == ev+1){
            cout << "Roy";
        }
        else cout << "Hridoy";
    }
    cout << endl;
}

int32_t main()
{
    faf auto st = clock();
    test
    crack();
    cerr << 1.0 * (clock() - st) / CLOCKS_PER_SEC << endl;
    return 0;
}

/*
    od = 5, ev = 5;
    roy hridoy
r    4-5
h    3-5
r    3-4
h    3-3
r    2-3
h    1-3
r    1-2
h    1-1
r    0-1
h    
r wins
*/

Information

Submit By
Type
Submission
Problem
P1102 Odd-Even Game
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-04 13:01:49
Judged At
2024-11-11 02:42:54
Judged By
Score
1
Total Time
19ms
Peak Memory
580.0 KiB