/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Wrong Answer 55ms 580.0 KiB
#3 Wrong Answer 19ms 324.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==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