/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 404.0 KiB
#2 Accepted 53ms 548.0 KiB
#3 Accepted 19ms 532.0 KiB
#4 Accepted 15ms 536.0 KiB
#5 Accepted 60ms 532.0 KiB
#6 Accepted 60ms 540.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define int             long long
#define pb              push_back
#define endl            '\n'
#define pp              pair<int,pair<int,int>>
#define asort(a,n)      sort(a,a+n)
#define arrout(a,n)     for(int i=0;i<n;i++)cout<<a[i]<<" ";
#define vcout(v)        for(auto i:v)cout<<i<<" ";
#define vsort(v)        sort(v.begin(),v.end())
#define vrsort(v)       sort(v.rbegin(),v.rend());
#define YES             cout<<"YES"<<endl
#define NO              cout<<"NO"<<endl
#define yes             cout<<"yes"<<endl
#define no              cout<<"no"<<endl
#define Yes             cout<<"Yes"<<endl
#define No              cout<<"No"<<endl
#define pqr             priority_queue<int,vector<int>,greater<int>>
#define debug           cout<<"HERE"<<endl;
//void edm()
//{
//    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
//#ifndef ONLINE_JUDGE
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
//#endif
//}
void solve()
{
    int n;cin>>n;
    int od=0,ev=0;
    for(int i=0;i<n;i++)
    {
        int x;cin>>x;
        if(x%2)ev++;
        else od++;
    }
    if(ev==od)
    {
        cout<<"Hridoy"<<endl;
        return;
    }
    int dif = max(od,ev) - min(od,ev);
    if(min(od,ev)%2==1)
    {
        cout<<"Roy"<<endl;
        return;
    }
    else
    {
        if(dif>1)
        {
            cout<<"Hridoy"<<endl;
        }
        else
        {
            cout<<"Roy"<<endl;
        }
    }
}
int32_t main()
{
//    edm();
    int t = 1;
    cin >> t;
    for(int i=1;i<=t;i++)
    {
        solve();
    }
}

Information

Submit By
Type
Submission
Problem
P1102 Odd-Even Game
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-04 18:58:22
Judged At
2024-11-11 02:42:15
Judged By
Score
100
Total Time
60ms
Peak Memory
548.0 KiB