/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 540.0 KiB
#2 Wrong Answer 11ms 836.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while (T--) {
        int N;
        cin >> N;
        int E = 0, O = 0;
        for (int i = 0; i < N; i++) {
            int x;
            cin >> x;
            if (x & 1) ++O;
            else       ++E;
        }
        // Roy wins iff |E - O| >= 2 and the smaller of (E, O) is odd
        if (abs(E - O) >= 2 && min(E, O) % 2 == 1) {
            cout << "Roy\n";
        } else {
            cout << "Hridoy\n";
        }
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1102 Odd-Even Game
Language
C++17 (G++ 13.2.0)
Submit At
2025-05-14 16:09:18
Judged At
2025-05-14 16:09:18
Judged By
Score
0
Total Time
11ms
Peak Memory
836.0 KiB