My issue
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
while(t--){
int x, y;
cin >> x >> y;
if((x>=1)==(y>=1))
cout<< "YES" << endl;
else cout << "NO"<<endl;
}
return 0;
}
Problem Link: FOOTCUP Problem - CodeChef
@dassharmi15
In the given problem, we just need to find whether X is equal to Y and they are both non-zero.
In your code, the if condition has not been properly written.
if((x>=1)==(y>=1))
Instead of writing this, you should have used relational operators for each condition like;
if((x==y) && (x!=0))
Here is my code for reference.
# cook your dish here
for _ in range(int(input())):
x,y=map(int,input().split())
if((x==y)and(x!=0)):
print('YES')
else:
print('NO')