#include "bits/stdc++.h" using namespace std; int main() { int t, s1, s2, lead; cin >> t; vector<int>p1; vector<int>p2; while(t--) { cin >> s1 >> s2; if(s1> s2) { p1.push_back(s1-s2); } else { p2.push_back(s2-s1); } } int max1 = *max_element(p1.begin(),p1.end()); int max2 = *max_element(p2.begin(),p2.end()); if( max1 > max2) cout << "1 " << max1; else cout << "2 " << max2; }
↧
CodeChef beginner - The Lead Game (TLG) whats wrong in my code?
↧