My issue
why my code is not working… its giving correct test case
My code
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
int max_lead = 0;
int a[t], b[t];
bool _2isWinner = true;
for (int i = 0; i < t; i++) {
cin >> a[i] >> b[i];
if (a[i] > b[i] && a[i] - b[i] > max_lead) {
max_lead = a[i] - b[i];
_2isWinner = false;
}
if (b[i] > a[i] && b[i] - a[i] > max_lead) {
max_lead = b[i] - a[i];
}
}
cout << (!_2isWinner ? 1 : 2) << " " << max_lead;
return 0;
}
Problem Link: TLG Problem - CodeChef