/ SeriousOJ /

Record Detail

Compile Error

foo.cc:41:2: error: stray '#' in program
   41 | }#include <bits/stdc++.h>
      |  ^
foo.cc:41:3: error: 'include' does not name a type
   41 | }#include <bits/stdc++.h>
      |   ^~~~~~~
foo.cc:51:6: error: redefinition of 'void solve()'
   51 | void solve() {
      |      ^~~~~
foo.cc:11:6: note: 'void solve()' previously defined here
   11 | void solve() {
      |      ^~~~~
foo.cc:71:8: error: redefinition of 'int main()'
   71 | signed main() {
      |        ^~~~
foo.cc:31:8: note: 'int main()' previously defined here
   31 | signed main() {
      |        ^~~~

Code

#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define ld long double
#define endl '\n'
#define MIR183_PC ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

void solve() {
    // Your code here
    ll n;
    cin>>n;
    vector<ll> v(n);
    ll odd=0,even=0;
    for(ll i=0;i<n;i++){
        cin>>v[i];
        if(v[i]%2==0) even++;
        else odd++;
    }
    ll mn=min(odd,even);
    if(mn%2==0){
        cout<<"Hridoy"<<endl;
    }else{
        cout<<"Roy"<<endl;
    }

}

signed main() {
    MIR183_PC;
    // Always use ll, int may give TLE
    ll tt;
    tt=1;
    cin >> tt;
    while (tt--) {
        solve();
    }
    return 0;
}#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define ld long double
#define endl '\n'
#define MIR183_PC ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

void solve() {
    // Your code here
    ll n;
    cin>>n;
    vector<ll> v(n);
    ll odd=0,even=0;
    for(ll i=0;i<n;i++){
        cin>>v[i];
        if(v[i]%2==0) even++;
        else odd++;
    }
    ll mn=min(odd,even);
    if(mn%2==0){
        cout<<"Hridoy"<<endl;
    }else{
        cout<<"Roy"<<endl;
    }

}

signed main() {
    MIR183_PC;
    // Always use ll, int may give TLE
    ll tt;
    tt=1;
    cin >> tt;
    while (tt--) {
        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 16:17:17
Judged At
2024-12-17 11:35:05
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes