/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 508.0 KiB
#2 Wrong Answer 22ms 604.0 KiB
#3 Wrong Answer 13ms 564.0 KiB

Code

#include<bits/stdc++.h>
#define ll long long
#define endl '\n'

using namespace std;

int32_t main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;

        vector<int> a(n);
        int even = 0, odd = 0;
        for (auto &k : a) {
            cin >> k;
            if (k & 1) odd++;
            else even++;
        }

        if (n == 1) cout << "Roy" << endl;
        else if (even == odd || ((even > 0 && odd == 0 || odd > 0 && even == 0) ) ) cout << "Hridoy" << endl;
        else if (even % 2 == 0 && odd % 2 != 0 || even % 2 != 0 && odd % 2 == 0 || even % 2 == 0 && odd % 2 == 0) cout << "Roy" << endl;
        else cout << "Hridoy" << endl;

    }

    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:59:22
Judged At
2024-12-17 11:33:37
Judged By
Score
1
Total Time
22ms
Peak Memory
604.0 KiB