/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 38ms 772.0 KiB
#3 Wrong Answer 19ms 492.0 KiB
#4 Wrong Answer 17ms 540.0 KiB
#5 Accepted 52ms 1.0 MiB
#6 Accepted 54ms 936.0 KiB

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){
            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 17:04:00
Judged At
2024-10-03 17:04:00
Judged By
Score
41
Total Time
54ms
Peak Memory
1.0 MiB