/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 540.0 KiB
#2 Wrong Answer 32ms 604.0 KiB

Code

#include <iostream>
#include <vector>
using namespace std;

#define ll long long
#define vi vector<ll>

void solve() {
    ll n;
    cin >> n;
    vi p(n);
    ll odd = 0, even = 0;

    for (ll i = 0; i < n; i++) {
        cin >> p[i];
        if (p[i] % 2 == 1) 
            odd++;
        else 
            even++;
    }
    if (odd > even) {
        cout << "Roy" << endl;
    } else if (even > odd) {
        if (n % 2 == 0) 
            cout << "Hridoy" << endl;
        else 
            cout << "Roy" << endl;
    } else {
        cout << "Hridoy" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll t;
    cin >> t;
    while (t--) {
        solve();
    }
    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 17:51:18
Judged At
2024-12-17 11:32:13
Judged By
Score
0
Total Time
32ms
Peak Memory
604.0 KiB