/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 588.0 KiB
#2 Wrong Answer 13ms 568.0 KiB
#3 Wrong Answer 9ms 560.0 KiB
#4 Accepted 6ms 328.0 KiB
#5 Accepted 21ms 560.0 KiB
#6 Accepted 17ms 540.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define f(i,x,y) for(int i=x;i<y;i++)
#define f2(i,x,y) for(int i=x;i>=y;i--)
#define pii pair<int,int>
#define Fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int MOD =1000000007;
const int INF = 1e18;
const int N = 2e5;
 
void solve(int tc){
    int n; cin >> n;
    int x = 0 , y = 0;
    for(int i=0,z;i<n;i++){
        cin >> z;
        if(z%2)y++;
        else x++;
    }
    if(x==y)cout << "Hridoy" << endl;
    else if(x==1 or y==1)cout << "Roy" << endl;
    else if(x==0 or y==0)cout << "Hridoy" << endl;
    else{
        int mn = min(x,y);
        if(mn%2)cout << "Roy" << endl;
        else cout << "Hridoy" << endl;
    }
}
int32_t main(){

    Fast

    int t=1;

    cin >> t;

    for(int tc=1;tc<=t;tc++){

        solve(tc);
    }
    return 0;
}

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 16:32:08
Judged At
2024-10-03 16:32:08
Judged By
Score
61
Total Time
21ms
Peak Memory
588.0 KiB