problem
my solution
#include<bits/stdc++.h>
using namespace std;
int main()
{
int num{};
int w{};
int L{},temp{};
vector lead{};
cin>>num;
while(num–)
{
int s1{},s2{},temp{};
cin>>s1>>s2;
lead.push_back(s1-s2);
}
for(int i=0 ; i<lead.size() ; i++)
{
if(lead.at(i)<0)
{
temp=lead.at(i)*(-1);
}
else
temp=lead.at(i);
if(temp>L)
{
L=temp;
if(lead.at(i)<0)
w=2;
else
w=1;
}
}
cout<<w<<" "<<L;
return 0;
}
when i use custom input given in the problem i get correct answer
but when i run without custom input i get output 0 0
i dont understand.