My issue
My sample test case is passing and I also tried random test cases but still when I submit the code it throws none test case passed. Please help debug
My code
#include <bits/stdc++.h>
using namespace std;
int main(){
long long int t;
cin>>t;
for (int tc = 0; tc < t; tc++)
{
int n;
cin>>n;
vector <bool> om;
vector <bool> addy;
for (int i = 0; i < n; i++)
{
long long int temp;
cin>>temp;
if(temp!= 0)
om.push_back(true);
else
om.push_back(false);
}
for (int i = 0; i < n; i++)
{
long long int temp;
cin>>temp;
if(temp!= 0)
addy.push_back(true);
else
addy.push_back(false);
}
long long int taddy = 0,tom = 0;
long long int maddy = 0, mom = 0;
for(long long int i = 0; i<n;i++){
if (om[i] == true)
tom+=1;
else{
if(tom>mom){
mom = tom;
tom = 0;
}
}
}
if(mom == 0){
mom = tom;
}
for(long long int i = 0; i<n;i++){
if (addy[i] == true)
taddy+=1;
else{
if(taddy>maddy){
maddy = taddy;
taddy = 0;
}
}
}
if(maddy == 0){
maddy = taddy;
}
if(mom>maddy)
cout<<"Om"<<endl;
else if(mom == maddy){
cout<<"Draw"<<endl;
}
else{
cout<<"Addy"<<endl;
}
}
}
Problem Link: CS2023_STK Problem - CodeChef