/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 65ms 592.0 KiB
#3 Accepted 30ms 568.0 KiB
#4 Accepted 22ms 644.0 KiB
#5 Accepted 82ms 1.277 MiB
#6 Accepted 102ms 1.289 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
int main()
{
    ll tc;
    cin>>tc;
    while(tc--)
    {
        ll n;
        cin>>n;
        vector<ll>v(n);
        map<ll,ll>mp;
        for(int i=0;i<n;i++){
            cin>>v[i];
            mp[v[i]%2]++;
        }
        ll mn=min(mp[0],mp[1]);
        if(n==1)
            cout<<"Roy\n";
        else if(mp[1]==0 || mp[0]==0 || mp[1]==mp[0])
            cout<<"Hridoy\n";
        else if(mn%2)
            cout<<"Roy\n";
        else if(mp[0]+1==mp[1] || mp[1]+1==mp[0])
            cout<<"Roy\n";
        else
            cout<<"Hridoy\n";
        
    }
}

Information

Submit By
Type
Submission
Problem
P1102 Odd-Even Game
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-05 06:27:09
Judged At
2024-11-11 02:40:29
Judged By
Score
100
Total Time
102ms
Peak Memory
1.289 MiB