Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(a) a.begin(), a.end()
#define endl '\n'
void solve()
{
ll n;
cin >> n;
vector<ll> v(n);
ll od = 0, ev = 0;
for (auto &x : v)
{
cin >> x;
if (x % 2 == 0)
ev++;
else
od++;
}
ll mn = min(od, ev);
if (n == 1)
{
cout << "Roy" << endl;
return;
}
if (n % 2==0)
{
if (od == 0 || ev == 0)
{
cout << "Hridoy\n";
}
else if (mn % 2)
{
cout << "Roy" << endl;
}
else
{
cout << "Hridoy" << endl;
}
}
else
{
if (od == 0 || ev == 0)
{
cout << "Hridoy\n";
}
else
{
cout << "Roy" << endl;
}
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll t;
cin >> t;
while (t--)
{
solve();
}
}
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:49:15
- Judged At
- 2024-11-11 02:47:28
- Judged By
- Score
- 1
- Total Time
- 16ms
- Peak Memory
- 600.0 KiB