/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 12ms 576.0 KiB
#3 Wrong Answer 6ms 584.0 KiB

Code

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define all(a) a.begin(), a.end()
#define endl '\n'

void solve()
{
    ll n;
    cin >> n;
    vector<ll> v(n);
    ll od = 0, ev = 0;
    for (auto &x : v)
    {
        cin >> x;
        if (x % 2 == 0)
            ev++;
        else
            od++;
    }
    ll mn = min(od, ev);
    if (n == 1)
    {
        cout << "Roy" << endl;
        return;
    }
    if(od==0||ev==0)
    {
        cout<<"Hridoy"<<endl;return;
    }
    if(od==ev)
    {
         cout<<"Roy"<<endl;
         
    }
    else
    {
       if(od%2==0)
       {
        cout<<"Roy\n";
       }
       else
       {
        cout<<"Hridoy\n";
       }
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll t;
    cin >> t;
    while (t--)
    {
        solve();
    }
}

Information

Submit By
Type
Submission
Problem
P1102 Odd-Even Game
Contest
Brain Booster #6
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 17:40:28
Judged At
2024-12-17 11:32:30
Judged By
Score
1
Total Time
12ms
Peak Memory
584.0 KiB