My issue
My code
#include <stdio.h>
int main(void) {
// your code goes here
return 0;
}
Problem Link: CS2023_STK Problem - CodeChef
#include <stdio.h>
int main(void) {
// your code goes here
return 0;
}
Problem Link: CS2023_STK Problem - CodeChef
#include<bits/stdc++.h>
using namespace std;
int main() {
//ios::sync_with_stdio(false); cin.tie(NULL);
int t;
cin >> t;
for (int p = 0; p < t; p++) {
int N;
cin >> N;
vector<int> om(N);
vector<int> addy(N);
for (int i = 0; i < N; i++) {
cin >> om[i];
}
for (int i = 0; i < N; i++) {
cin >> addy[i];
}
int maxom = 0;
int maxaddy= 0;
int currentom = 0;
int currentaddy = 0;
for (int i = 0; i < N; i++) {
if (om[i] > 0) {
currentom++;
} else {
currentom = 0;
}
if (addy[i] > 0) {
currentaddy++;
} else {
currentaddy = 0;
}
maxom= max(maxom, currentom);
maxaddy= max(maxaddy, currentaddy);
}
if (maxom > maxaddy) {
cout << "OM" << endl;
} else if (maxaddy > maxom) {
cout << "ADDY" << endl;
} else {
cout << "DRAW" << endl;
}
}
return 0;
}