Wrong Answer
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;cin>>t;
while(t--){
int n;cin>>n;
int arr[n];
int e=0,o=0;
for(int i=0;i<n;i++){
cin>>arr[i];
if(arr[i]%2==0){
e++;
}
else{
o++;
}
}
int t1=e%2;
int t2=o%2;
if(e==1 || o==1){
cout<<"Roy"<<endl;
}
else if(e==0 || o==0){
cout<<"Hridoy"<<endl;
}
else if(e-o==1 || o-e==1){
cout<<"Roy"<<endl;
}
else if((t1==0 && t2!=0) || (t1!=0 && t2==0)){
cout<<"Roy"<<endl;
}
else if(t1!=0 && t2!=0){
cout<<"Roy"<<endl;
}
else if(t1==0 && t2==0){
cout<<"Hridoy"<<endl;
}
}
}
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:57:45
- Judged At
- 2024-11-11 02:47:11
- Judged By
- Score
- 1
- Total Time
- 55ms
- Peak Memory
- 580.0 KiB