there is some fault I want to report in
I have watched the editorial and know the correct answer now.But yesterday , I tried two codes using same approaches where one is more optimised version of other(because I used /n and scanf ).In approach 1 , it showed TLE and in approach 2 it showed WA. Shouldn’t it have showed WA for both?
APPROACH 1
#include <iostream>
using namespace std;
int main() {
// your code goes here
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int t;
cin>>t;
while(t--)
{
long long int a,b;
cin>>a>>b;
if(a==1&&(b==2||b==4))
{
cout<<"yes"<<endl;
continue;
}
else if(a==3&&b==4)
{
cout<<"yes"<<endl;
continue;
}
else
{
cout<<"No"<<endl;
continue;
}
}
return 0;
}
APPROACH 2
#include <iostream>
using namespace std;
int main() {
// your code goes here
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int t;
scanf("%lld",&t);
while(t--)
{
long long int a,b;
scanf("%lld%lld",&a,&b);
if(a==1&&(b==2||b==4))
{
printf("yes\n");
continue;
}
else if(a==3&&b==4)
{
printf("yes\n");
continue;
}
else
{
printf("No\n");
continue;
}
}
return 0;
}