/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Wrong Answer 12ms 600.0 KiB
#3 Wrong Answer 6ms 320.0 KiB

Code

#include <bits/stdc++.h>
#define ll long long
#define endll '\n';
#define pb push_back
#define all(v) v.begin(), v.end()
using namespace std;

const int mod = 1e9 + 7, N = 1e6;
int dp[N];
int rec(int x)
{
    if (x < 0)
        return 1e5;
    if (x == 0)
        return 0;
    if (dp[x] != -1)
        return dp[x];
    int ans = 1e9;
    ans = min(ans, rec(x - 2) + 1);
    ans = min(ans, rec(x - 3) + 1);
    return dp[x] = ans;
}
void solve()
{

    int n;
    cin >> n;
    int odd = 0, evn = 0;
    for (int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        if (x % 2)
            odd++;
        else
            evn++;
    }


    int flg = 0;
    
    if (min(odd, evn) == 0)
    {
        flg = 2;
    }

    if (n == 1)
    {
        flg = 1;
    }
    if(odd && evn) {
        flg = 1;
    }


    if(flg == 1) {
        cout << "Roy\n";
    }
    else cout << "Hridoy\n";
}

int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
 
    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 15:48:03
Judged At
2024-11-11 02:50:00
Judged By
Score
1
Total Time
12ms
Peak Memory
600.0 KiB