'Python problem , codechef shows wrong answer while submitting the code "chef and football match" problem

I was solving the codechef watchfb problem and when i run my program in my ide and also in codechef ide it works fine, but still when i submit my solution it shows me wrong answer error and i am unable to find any error in my solution. This is the link of the problem enter image description here

The program submitted by me is as follows.

t=int(input())#no of test cases
for i in range(t):
    n=int(input())
    x,y=0,0
    for j in range(n):#no of times replies given
            tp,b,c=map(int,input().split())
            if tp==1:
                    x=b
                    y=c
                    print("YES")
            if tp==2:
                if (min(b,c)<max(x,y)) or ((max(x,y)==max(b,c)) and (min(x,y)==min(b,c))) or (b==c):
                    print("YES")
                    if x>y:
                        x=max(b,c)
                        y=min(b,c)
                    else:
                        y=max(b,c)
                        x=min(b,c)
                elif (min(b,c)>=max(x,y)):
                    x=max(b,c)
                    y=min(b,c)
                    print("NO")


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source