Fault in REALBIN problem

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;
}

Mentioned many times e.g. REALBIN - Editorial - #14 by daymarebait_02 , REALBIN TLE for same logic for my submission as ACCEPTED - #12 by errormaybe etc.

Edit:

TLE’s take priority over WA in the online judge, I believe (if your solution doesn’t provide an answer within the time limits, it can’t tell whether it’s WA or not).

1 Like

thanks for clearing that out
I used to think that if it gives TLE then my logic is correct , it only needs to be optimised.

2 Likes