ZhenlongDai/ACPR huggingface dataset:
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math


def a():
    s = input()
    if s[-1] == 's':
        print(s + 'es')
    else:
        print(s + 's')


def b():
    n = int(input())
    d = []
    for i in range(n):
        d.append(list(map(int, input().split())))
    for i in range(n - 2):
        if d[i + 2][0] == d[i + 2][1] and \
            d[i + 1][0] == d[i + 1][1] and \
                d[i][0] == d[i][1]:
            print('yes')
            break
    else:
        print('No')


def c():
    pass


def d():
    pass



b()




Failing test case input:
5
1 2
6 6
4 4
3 3
3 2

Expected output:
Yes

Actual output:
yes


Fixed submission (verdict: Accepted):
import math


def a():
    s = input()
    if s[-1] == 's':
        print(s + 'es')
    else:
        print(s + 's')


def b():
    n = int(input())
    d = []
    for i in range(n):
        d.append(list(map(int, input().split())))
    for i in range(n - 2):
        if d[i + 2][0] == d[i + 2][1] and \
            d[i + 1][0] == d[i + 1][1] and \
                d[i][0] == d[i][1]:
            print('Yes')
            break
    else:
        print('No')


def c():
    pass


def d():
    pass



b()

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

affilé = 0
ok = 0


for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé = 0
  

  if affilé == 3:
    ok = 1

if ok == 0:
  print('NO')
else:
  print('YES')


Failing test case input:
5
1 -1
8 4
4 1
6 1
2 2

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input())

affilé = 0
ok = 0


for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé = 0
  

  if affilé == 3:
    ok = 1

if ok == 0:
  print('No')
else:
  print('Yes')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ds1 = []
ds2 = []
for _ in range(n):
    d1,d2 = list(map(int, input().split()))
    ds1.append(d1)
    ds2.append(d2)

matched = [d1 == d2 for d1,d2 in zip(ds1,ds2)]
cnt = 0
for m in matched:
    cnt = cnt+1 if m else 0
    if m == 3:
        break

if cnt == 3:
    print('Yes')
else:
    print('No')

Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
ds1 = []
ds2 = []
for _ in range(n):
    d1,d2 = list(map(int, input().split()))
    ds1.append(d1)
    ds2.append(d2)

matched = [d1 == d2 for d1,d2 in zip(ds1,ds2)]
cnt = 0
for m in matched:
    cnt = cnt+1 if m else 0
    if cnt == 3:
        break

if cnt == 3:
    print('Yes')
else:
    print('No')
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
l = []
for _ in range(n):
    d1,d2 = map(int,input().split())
    l.append(d1)
    l.append(d2)

for i in range(len(l)-2):
    if l[i] == l[i+1] == l[i+2] == 3:
        print ('Yes')
        exit ()
print ('No')


Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())

z_count = 0
for _ in range(n):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        z_count += 1
    else:
        z_count = 0

    if z_count == 3:
        print ("Yes")
        exit ()

print ('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

affilé = 0

for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé == 0
  

  if affilé == 3:
    print('YES')
    exit()

  print('NO')


Failing test case input:
5
0 0
11 2
4 1
3 0
2 2

Expected output:
No


Actual output:
NO
NO
NO
NO
NO


Fixed submission (verdict: Accepted):
n = int(input())

affilé = 0
ok = 0


for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé = 0
  

  if affilé == 3:
    ok = 1

if ok == 0:
  print('No')
else:
  print('Yes')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
ans=0
D=[]
for i in range(n):
  a,b=map(int, input().split())
  D.append([a,b])


for i in range(len(D)):
  if D[i][0]==D[i][1]:
    ans +=1

if ans>=3:
  print("Yes")
  
else:
  print("No")

Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
ans=0
D=[]
A=[]
for i in range(n):
  a,b=map(int, input().split())
  D.append([a,b])


for i in range(len(D)):
  if D[i][0]==D[i][1]:
    ans +=1
  else:
    if ans>0:
      ans = 0
  A.append(ans)
  
if max(A) >= 3:
  print("Yes")
  
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
x=[0]*N
y=[0]*N
L=[0]*N

flag = "No"

for i in range(N):
	x[i],y[i] = map(int, input().split())

for i in range(N):
  if x[i]==y[i]:
  	L[i]=1



for i in range (N-2):
  
  if L[i] == L[i+1] == L[i+2]:
    flag = "Yes"

print(flag)
    

Failing test case input:
5
1 -2
8 4
4 0
6 1
3 3

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
x=[0]*N
y=[0]*N
L=[0]*N

flag = "No"

if N <3:
  flag = "No"

else:

  for i in range(N):
      x[i],y[i] = map(int, input().split())

  for i in range(N):
    if x[i]==y[i]:
      L[i]=1

  

  for i in range (N-2):
    
    if L[i] == L[i+1] == L[i+2] == 1:
      flag = "Yes"



print(flag)
Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
cnt = 0
n = int(input())
for i in range(0,n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        cnt += 1
        if cnt == 3 :
            print("Yes")
            break
    else:
        cnt == 0
        
    if i == n-1:
        print("No")

Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
10 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
cnt = 0
n = int(input())
for i in range(0,n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        cnt += 1
        if cnt == 3 :
            print("Yes")
            break
    elif  cnt >= 0 and d1 != d2:
        cnt = 0 
    if i == n-1:
        print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
count=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    count+=1
if count>=3:
  print("Yes")
else:
  print("No")

Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
count=0
ren=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    if count<3:
      count+=1
      ren=1
  elif count<3:
    count=0
if count>=3:
  print("Yes")
else:
  print("No")

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())

pv = []
con = 0

while n > 0:
    n -= 1
    s = str(input())
    d = s.split()
    if d[0] == d[1]:
        con += 1
    else:
        pv += [con]
        con = 0

pv += [con]
ans = max(pv)

if ans >= 3:
    print('Yes')
else:
    print('NO')

Failing test case input:
5
1 -2
8 4
4 0
6 1
3 3

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input())

pv = []
con = 0

while n > 0:
    n -= 1
    s = str(input())
    d = s.split()
    if d[0] == d[1]:
        con += 1
    else:
        if con >= 3:
            break
        pv += [con]
        con = 0

pv += [con]
ans = max(pv)

if ans >= 3:
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input(""))
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]
for a in range(N):
  if x[a] == y[a]:
    print("Yes")
    e = 1
    break
  else:
    e = 0
if e == 0:
  print("No")

Failing test case input:
5
0 0
1 2
4 0
0 2
1 4

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input(""))
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]
b = 0
for a in range(N):
  if x[a] == y[a]:
    b += 1
    if b == 3:
      print("Yes")
      break
  else:
    b = 0
if b < 3:
  print("No")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = 0
f1, f2, f3 = 0, 0, 0
for i in range(n):
    f3 = f2
    f2 = f1
    d1, d2 = map(int, input().split())
    f1 = d1 == d2
    if f1 == f2 == f3:
        ans = 1
print('Yes' if ans else 'No')

Failing test case input:
5
0 -1
11 2
4 1
3 0
4 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
f1, f2, f3 = 0, 0, 0
for i in range(n):
    f3 = f2
    f2 = f1
    d1, d2 = map(int, input().split())
    f1 = d1 == d2
    if f1 == f2 == f3 == 1:
        ans = 1
print('Yes' if ans else 'No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
input=__import__('sys').stdin.readline
ans='NO'
cs=0
for i in range(int(input())):
	a,b=map(int,input().split())
	if a==b:cs+=1
	else:cs=0
	if cs>=3:ans='YES'
print(ans)

Failing test case input:
5
1 -1
8 4
4 0
6 1
3 3

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
input=__import__('sys').stdin.readline
ans='No'
cs=0
for i in range(int(input())):
	a,b=map(int,input().split())
	if a==b:cs+=1
	else:cs=0
	if cs>=3:ans='Yes'
print(ans)

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
ans=0
D=[]
for i in range(n):
  a,b=map(int, input().split())
  D.append([a,b])


for i in range(len(D)):
  if D[i][0]==D[i][1]:
    ans +=1
  else:
    if ans>0:
      ans -= 1

if ans>=3:
  print("Yes")
  
else:
  print("No")

Failing test case input:
5
1 2
6 6
4 4
3 3
3 2

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
ans=0
D=[]
A=[]
for i in range(n):
  a,b=map(int, input().split())
  D.append([a,b])


for i in range(len(D)):
  if D[i][0]==D[i][1]:
    ans +=1
  else:
    if ans>0:
      ans = 0
  A.append(ans)
  
if max(A) >= 3:
  print("Yes")
  
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

lst=[]
for i in range(N):
    lst.append(list(map(int,input().split())))

cnt = 0
for a, b in lst:
  if a == b:
    cnt += 1
  else:
    continue

if cnt >= 3:
  print('Yes')
else:
  print('No')

Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
10 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

lst=[]
for i in range(N):
    lst.append(list(map(int,input().split())))

cnt = 0
for i in range(N):
  if i < N - 2:
    a, b = lst[i]
    c, d = lst[i + 1]
    e, f = lst[i + 2]
    if a == b and c == d and e == f:
      cnt += 1
    else:
      continue
if cnt >= 1:
  print('Yes')
else:
  print('No')
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

def main():
    N = int(input())
    zoro = 0
    for i in range(N):
        Ds = [int(s) for s in sys.stdin.readline().split()]
        if(Ds[0] == Ds[1]):
            zoro += 1
            if(zoro > 2):
                print("Yes")
                return(0)
    print("No")

main()

Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys

def main():
    N = int(input())
    zoro = 0
    for i in range(N):
        Ds = [int(s) for s in sys.stdin.readline().split()]
        if(Ds[0] == Ds[1]):
            zoro += 1
            if(zoro > 2):
                print("Yes")
                return(0)
        else:
            zoro = 0
    print("No")

main()

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    if(j>0):
      j += 1
  else:
    j=0
  if(j>=3):
    ans = "Yes"
print(ans)


Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    j += 1
  else:
    j=0
  if(j>=3):
    ans = "Yes"
print(ans)

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
T=False
k=0
for i in range(N):
    D1,D2=map(int,input().split())
    if D1==D2:
        k+=1
        if k>=3:
            T=True
    else:
        k=0
    print(k)
if T:
    print("Yes")
else:
    print("No")

Failing test case input:
5
1 -2
8 4
5 0
6 1
3 3

Expected output:
No


Actual output:
0
0
0
0
1
No


Fixed submission (verdict: Accepted):
N=int(input())
T=False
k=0
for i in range(N):
    D1,D2=map(int,input().split())
    if D1==D2:
        k+=1
        if k>=3:
            T=True
    else:
        k=0
if T:
    print("Yes")
else:
    print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    if(j>0):
      j += 1
    if(j==3):
      ans = "Yes"
  else:
    j=0
print(ans)

Failing test case input:
6
1 0
2 2
3 3
4 4
5 0
10 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    j += 1
  else:
    j=0
  if(j>=3):
    ans = "Yes"
print(ans)
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

d12 = [map(int, input().split()) for _ in range(n)]
d1, d2 = [list(i) for i in zip(*d12)]

for i in range(n-2):
  if d1[i] == d2[i]:
    if d1[i+1] == d2[i+1]:
      if d1[i+2] == d2[i+2]:
        print("YES")
        break
else:
  print("NO")

Failing test case input:
5
0 0
6 2
4 1
3 0
2 2

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input())

d12 = [map(int, input().split()) for _ in range(n)]
d1, d2 = [list(i) for i in zip(*d12)]

for i in range(n-2):
  if d1[i] == d2[i]:
    if d1[i+1] == d2[i+1]:
      if d1[i+2] == d2[i+2]:
        print("Yes")
        break
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
ans=0
for i in range(n):
	a,b=map(int,input().split())
	if a==b:
		ans+=1
	else:
		ans=0
if ans>=3:
	print('Yes')
else:
	print('No')

Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
ans=0
f=0
for i in range(n):
	a,b=map(int,input().split())
	if a==b:
		ans+=1
	else:
		ans=0
	if ans>=3:
		f=1
if f==1:
	print('Yes')
else:
	print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

xy = [map(int,input().split()) for _ in range(N)]
x,y = [list(i) for i in zip(*xy)]

ans = 0

for i in range(N):
    if x[i] == y[i]:
        ans +=1
    else:
        ans = 0
        
if ans >= 3:
    print("Yes")
    
else:
    print("No")

Failing test case input:
6
1 0
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())

xy = [map(int,input().split()) for _ in range(N)]
x,y = [list(i) for i in zip(*xy)]

ans = 0
flag = False

for i in range(N):
    if x[i] == y[i]:
        ans +=1
    elif ans >= 3:
        flag = True
        ans = 0
    else:
        ans = 0
        
if ans >= 3  or flag ==True:
    print("Yes")
    
else:
    print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
k=0
c=0
for i in range(n):
  a,b=map(int,input().split())
  if(a==b):
      k+=1
      if(k>=3):
          c=1
  else:
      k=0

if(c==1):
  print("YES")
else:
  print("NO")


Failing test case input:
6
-4 1
1 3
-1 1
4 12
2 0
0 2

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n=int(input())
k=0
c=0
for i in range(n):
  a,b=map(int,input().split())
  if(a==b):
      k+=1
      if(k>=3):
          c=1
  else:
      k=0

if(c==1):
  print("Yes")
else:
  print("No")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

flag = 0

for i in range(N):
    a,b = map(int,input().split())
    if a == b:
        flag += 1
    else:
        flag = 0

if flag >= 3:
    print("Yes")
else:
    print("No")

Failing test case input:
6
1 0
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())

flag = 0
ans = 0

for i in range(N):
    a,b = map(int,input().split())
    if a == b:
        flag += 1
        if flag == 3:
            ans += 1
    else:
        flag = 0
if ans >= 1:
    print("Yes")
else:
    print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

d  = []
for i in range(N):
    D1, D2 = map(int, input().split())
    if D1 == D2:
        ans = "same"
    else:
        ans = "no"
    d.append(ans)
flag = "No"
for i in range(N-2):
    if d[i] == d[i+1] and d[i+1] == d[i+2]:
        flag = "Yes"
print(flag)

Failing test case input:
5
1 -1
8 4
5 0
6 1
4 3

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

d  = []
for i in range(N):
    D1, D2 = map(int, input().split())
    if D1 == D2:
        ans = "same"
    else:
        ans = "different"
    d.append(ans)
flag = "No"
for i in range(N-2):
    if d[i] == "same" and d[i+1] == "same" and d[i+2] == "same":
        flag = "Yes"
print(flag)

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
D={}
for i in range(N):
    D[i]=input().split()

cou=0
for i in range(N):
    if D[i][0]==D[i][1]:
        cou+=1
    else:
        cou=0
    
    if cou == 3:
        print('Yes')
        break

if cou == 0:
    print('No')


Failing test case input:
5
1 -1
8 4
4 1
6 1
2 2

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
D={}
for i in range(N):
    D[i]=input().split()

cou=0
for i in range(N):
    if D[i][0]==D[i][1]:
        cou+=1
        if cou ==3:
            print('Yes')
            break
    else:
        cou=0

if cou < 3:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=[]
m=[]
for i in range(0,n):
  a,b=map(int,input().split())
  l.append(a)
  m.append(b)
c=0
for i in range(0,n):
  if l[i]==m[i]:
    c=c+1
  else:
    c=0
if c==3:
  print('Yes')
else:
  print('No')

Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
6 6

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
l=[]
m=[]
for i in range(0,n):
  a,b=map(int,input().split())
  l.append(a)
  m.append(b)
c=0
i=0
while i<=n-3:
  if l[i]==m[i] and l[i+1]==m[i+1] and l[i+2]==m[i+2]:
      c=3
  i=i+1
if c==3:
  print('Yes')
else:
  print('No')
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
count = 0
count_max = count
for i in range(N):
    di_1, di_2 = [int(i) for i in input().split()]
    if di_1 == di_2:
        count += 1
    else:
        count_max = max([count_max, count])
        count = 0
if count_max >= 3:
    print("Yes")
else:
    print("No")

Failing test case input:
6
1 0
2 2
3 3
4 4
5 5
10 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
count = 0
count_max = count
for i in range(N):
    di_1, di_2 = [int(i) for i in input().split()]
    if di_1 == di_2:
        count += 1
    else:
        count_max = max([count_max, count])
        count = 0
count_max = max([count_max, count])
if count_max >= 3:
    print("Yes")
else:
    print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
DD=[]
for i in range(N):
    DD.append(list(map(int,input().split())))
for i in range(N-2):
    if DD[i][0]==DD[i][1]:
        if DD[i+1][0]==DD[i+1][1]:
            if DD[i+2][0]==DD[i+2][1]:
                print("Yes")
                break
    elif i==N-3:print("No")

Failing test case input:
6
-2 1
2 3
6 1
4 4
2 0
8 4

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
DD=[]
for i in range(N):
    DD.append(list(map(int,input().split())))
for i in range(N-2):
    if DD[i][0]==DD[i][1]:
        if DD[i+1][0]==DD[i+1][1]:
            if DD[i+2][0]==DD[i+2][1]:
                print("Yes")
                break
            elif i+2==N-1:
                print("No")
                break
        elif i+1==N-2:
            print("No")
            break
    elif i==N-3:
        print("No")
        break

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a = [[int(i) for i in input().split()] for j in range(n)]
good = False
for i in range(n-3):
  ok = True
  for j in range(i, i+3):
    ok &= a[i][0] == a[i][1]
  good |= ok
print("Yes" if good else "No")

Failing test case input:
5
0 0
1 2
4 0
0 2
1 4

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = [[int(i) for i in input().split()] for j in range(n)]
good = False
for i in range(n-2):
  ok = True
  for j in range(i, i+3):
    ok &= a[j][0] == a[j][1]
  good |= ok
print("Yes" if good else "No")

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
i = int(input())
d = [list(map(int, input().split())) for i in range(i)]

c = 0
for i in range(len(d)):
    if (d[i][0] == d[i][1]):
        c += 1
print("Yes" if c >= 3 else "No")


Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys

i = int(input())
d = [list(map(int, input().split())) for i in range(i)]

c = 0
for i in range(len(d)):
    if (d[i][0] == d[i][1]):
        c += 1
        if (c >= 3):
          print("Yes")
          sys.exit(0)
    else:
      c = 0
print("No")
Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
i = int(input())
d = [list(map(int, input().split())) for i in range(i)]

c = 0
for i in range(len(d)):
    if (d[i][0] == d[i][1]):
        c += 1
print("Yes" if c <= 3 else "No")


Failing test case input:
5
1 3
0 1
4 0
0 1
1 6

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys

i = int(input())
d = [list(map(int, input().split())) for i in range(i)]

c = 0
for i in range(len(d)):
    if (d[i][0] == d[i][1]):
        c += 1
        if (c >= 3):
          print("Yes")
          sys.exit(0)
    else:
      c = 0
print("No")

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
d = []

for i in range(n) :
    input_line = list(map(int, input().split(" ")))
    d.append(input_line)

count = 0
answer = "no"
for i in range(n) :
    if d[i][0] == d[i][1] :
        count += 1
        if count > 1 :
            answer = "yes"
    else :
        count = 0
    
if answer == "yes" :
    print("Yes")
else :
    print("No")


Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):

n = int(input())
d = []

for i in range(n) :
    input_line = list(map(int, input().split(" ")))
    d.append(input_line)

count = 0
answer = "no"
for i in range(n) :
    if d[i][0] == d[i][1] :
        count += 1
        if count > 2 :
            answer = "yes"
    else :
        count = 0
    
if answer == "yes" :
    print("Yes")
else :
    print("No")

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())
D=[list(map(int, input().split())) for i in range(N)]
count=0
for j in range(N-2):
    if D[j][0]==D[j][1]:
        if D[j+1][0]==D[j+1][1]:
            if D[j+2][0]==D[j+2][1]:
                count = 1
if count==0:
    print('NO')
else:
    print('Yes')

Failing test case input:
5
1 -2
8 4
5 0
6 1
4 3

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
N=int(input())
D=[list(map(int, input().split())) for i in range(N)]
count=0
for j in range(N-2):
    if D[j][0]==D[j][1]:
        if D[j+1][0]==D[j+1][1]:
            if D[j+2][0]==D[j+2][1]:
                count = 1
if count==0:
    print('No')
else:
    print('Yes')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

d1=[]
d2=[]

cont=0
for i in range(N):
    D1,D2=map(int,input().split())

    d1.append(D1)
    d2.append(D2)

w1=set(d1)
w2=set(d2)        

w12=w1&w2

if len(w12)>=3:
    print("Yes")
else:
    print("No")



Failing test case input:
5
1 2
6 6
4 1
3 3
3 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

d1=[]
d2=[]

cont=0
for i in range(N):
    D1,D2=map(int,input().split())

    d1.append(D1)
    d2.append(D2)

for i in range(len(d1)):
    if d1[i]==d2[i]:
        cont+=1
    else:
        cont=0

    if cont==3:
        break
    
if cont>=3:
    print("Yes")
else:
    print("No")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

eq = 1
prev = False
for i in range(n):
    d = [int(s) for s in input().split(' ')]
    if d[0] == d[1]:
        if prev:
            eq += 1
        prev = True
    else:
        prev = False
        eq = 1

if eq >= 3:
    print('Yes')
else:
    print('No')


Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())

eq = 0
mx = 0
prev = False
for i in range(n):
    d = [int(s) for s in input().split(' ')]
    if d[0] == d[1]:
        if prev:
            eq += 1
        prev = True
        mx = max(eq, mx)
    else:
        prev = False
        eq = 0

if mx >= 2:
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input().strip())
count = 0
for i in range(n):
  a,b = map(int,input().strip().split())
  if a == b and count == 3:
    print('YES')
  elif a == b:
    count += 1
  else:
    count = 0
print('NO')

Failing test case input:
5
1 0
0 2
4 0
-1 1
1 3

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input().strip())
count = 0
for i in range(n):
  a,b = map(int,input().strip().split())
  if count == 3:
    print('Yes')
    exit(0)
  elif a == b:
    count += 1
  elif(a != b):
    count = 0
if count == 3:
	print('Yes')
else:
	print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
count = 0
temp = 0

for _ in range(N):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
    else:
        if temp < count:
            temp = count

if temp >= 3:
    print('Yes')
else:
    print('No')


Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
6 6

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
count = 0
flag = False

for _ in range(N):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
        if count == 3:
            flag = True

    else:
        count = 0

if flag == True:
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

number = 0
for i in range(n):
  if number == 3:
    print("Yes")
  a, b = map(int, input().split())
  if a == b:
    number += 1
  else:
    number = 0

print("No")


Failing test case input:
5
1 2
6 6
4 4
3 3
3 3

Expected output:
Yes


Actual output:
Yes
No


Fixed submission (verdict: Accepted):
n = int(input())

answer = "No"
number = 0
for i in range(n):
  a, b = map(int, input().split())
  if a == b:
    number += 1
  else:
    number = 0
  if number == 3:
    answer = "Yes"

print(answer)
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

for _ in range(N):
  D = map(int, input().split())
  D = list(D)
  if D[0] == D[1]:
    print('Yes')
    break
else:
  print('No')

Failing test case input:
5
0 0
1 2
4 0
-1 1
1 3

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

count = 0
for _ in range(N):
  D = map(int, input().split())
  D = list(D)
  if D[0] == D[1]:
    count += 1
    if count >= 3:
      print('Yes')
      break
    continue
  count = 0
else:
  print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
num=int(input())
re=0
for i in range(num):
    a=input().split(" ")
    if a[0]==a[1]:
        re +=1

if(re<3):
    print("No")
else:
    print("Yes")

Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
10 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
num=int(input())
re=0
res=0
for i in range(num):
    a=input().split(" ")
    if a[0]==a[1]:
        re +=1
        if re>=3:
            res=1
    else:
        re=0

if(res==0):
    print("No")
else:
    print("Yes")

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())

a = 0
for i in range(n):
    li = input().split()
    if(li[0]==li[1]):
        print(li[0])
        a+=1
    elif(a<3):
        a=0
    else:
        print("Yes")
        exit()
if(a>2):
    print("Yes")
    exit()

print("No")

Failing test case input:
5
1 0
8 4
4 0
6 1
2 2

Expected output:
No


Actual output:
2
No


Fixed submission (verdict: Accepted):
n=int(input())

a = 0
for i in range(n):
    li = input().split()
    if(li[0]==li[1]):
        a+=1
    elif(a<3):
        a=0
    else:
        print("Yes")
        exit()
if(a>2):
    print("Yes")
    exit()

print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
x=[]
for i in range(N):
    x.append(list(map(int,input().split())))
for i in range(N-2):
    if x[i][0]==x[i][1] and x[i+1][0]==x[i+1][1] and x[i+2][0]==x[i+2][1]:
        print("Yes")
        break
    else:
        print("No")
        break

Failing test case input:
6
1 0
2 2
3 3
4 4
5 5
10 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
x=[]
for i in range(N):
    x.append(list(map(int,input().split())))
for i in range(N-2):
    if x[i][0]==x[i][1] and x[i+1][0]==x[i+1][1] and x[i+2][0]==x[i+2][1]:
        print("Yes")
        break
else:
     print("No")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
count=0
for i in range(N):
    a,b=map(int,input().split())

    if a==b:
        count+=1
        if count==3:
            print("Yes")
            exit()
        else:
            pass
    if a!=b:
        count==0

if count!=3:
    print('No')
        

Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
10 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N=int(input())
count=0
for i in range(N):
    a,b=map(int,input().split())

    if a==b:
        count+=1
        if count==3:
            print("Yes")
            exit()
        else:
            pass
            
    else :
        count=0

if count !=3:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
c=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    c+=1
if c>=3:
  print("Yes")
else:
  print("No")

Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
c=0
m=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    c+=1
  else:
    c=0
  m=max(c,m)
if m>=3:
  print("Yes")
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
flag= True
count = 0
for i in range(n):
  a,b = list(map(int, input().split()))
  if a==b:
    count += 1
  else:
    count= 0
  if count==3:
    flag = True
if flag:
  print("Yes")
else:
  print("No")

Failing test case input:
5
1 0
-1 1
4 0
0 1
1 3

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
flag= False
count = 0
for i in range(n):
  a,b = list(map(int, input().split()))
  if a==b:
    count += 1
  else:
    count= 0
  if count==3:
    flag = True
if flag:
  print("Yes")
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
c=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    c+=1
  else:
    c=0
if c>2:
  print("Yes")
else:
  print("No")


Failing test case input:
5
1 2
6 6
4 4
3 3
3 2

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
c=0
m=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    c+=1
  else:
    c=0
  m=max(c,m)
if m>=3:
  print("Yes")
else:
  print("No")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

t = int(input())
count = 0
pre = 0
test = ''
for i in range(t):
    a, b = map(int, input().split())
    if (a == b):
        test = 'Yes'
        pre = 1
    else:
        pre = 0
        test = 'No'
    if test == 'Yes' and (pre == 1):
        count += 1
        test = 'Yes'
        pre = 1
if (count == 3) or (count == 6):
    print('Yes')
else:
    print('No')


Failing test case input:
6
1 1
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

t = int(input())
count = 1
result = 0
test = 0
p = ''
for i in range(t):
    a, b = map(int, input().split())
    
    if (a == b):
        result = 1
    else:
        result = 0
    
    if result == 1:
        test += 1
        if test >= 3:
            p = 'Yes'
    else:
        test = 0

if p == 'Yes':
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
count = 0
for i in range(N-1):
    a, b = list(map(int, input().split()))
    if a == b:
      count += 1
    else:
      count == 0
    if count == 3:
      print("Yes")
      break
print("No")      
    
    


  


Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes
No


Fixed submission (verdict: Accepted):
N = int(input())
c = 0
for i in range(N):
  a, b = map(int, input().split())
  if a == b:
    c += 1
  else:
    c =0
  if c == 3:
    break
if c == 3:
  print("Yes")
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools

N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]

D_1 = list(itertools.chain.from_iterable(D))
flag = False
for i in range(len(D_1)-2):
    if D_1[i] == D_1[i+1] == D_1[i+2]:
        flag = True


if flag:
    print('Yes')
else:
    print('No')


Failing test case input:
5
1 2
2 2
4 1
9 5
0 6

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]

cnt = 0
flag = False
for d in D:
    if d[0] == d[1]:
        cnt += 1
    else:
        cnt = 0

    if cnt >= 3:
        flag = True
        break

if flag:
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
a = []
for l in sys.stdin:
    a.append(l)

n = int(a[0])
Is = []
for i in range(n):
    Ds = list(map(int, a[i+1].split()))
    if Ds[0] == Ds[1]:
        Is.append(i)

Boooo = False
for i in range(len(Is)-2):
    if Is[i] == Is[i+1] and Is[i+1] == Is[i+2]:
        Boooo = True

if Boooo:
    print("Yes")
else:
    print("No")



Failing test case input:
5
1 2
6 6
4 4
3 3
3 3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N= int(input())
a = [input().split() for i in range(N)]

Is = []
for i in range(N):
    Ds = a[i]
    if Ds[0] == Ds[1]:
        Is.append(i)

Boooo = False
for i in range(len(Is)-2):
    if Is[i]+1 == Is[i+1] and Is[i+1]+1 == Is[i+2]:
        Boooo = True

if Boooo:
    print("Yes")
else:
    print("No")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
count=0
ren=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b and count<3:
    count+=1
    ren=1
  else:
    count=0
if count>=3:
  print("Yes")
else:
  print("No")

Failing test case input:
6
1 0
2 2
3 3
4 4
5 5
10 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
count=0
ren=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    if count<3:
      count+=1
      ren=1
  elif count<3:
    count=0
if count>=3:
  print("Yes")
else:
  print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
count=0
for i in range(n):
  me1,me2=list(map(int,input().split()))
  if me1==me2:
    count+=1
if count==n:
  print('Yes')
else:
  print('No')

Failing test case input:
5
1 2
6 6
4 4
3 3
3 3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
count=0
for i in range(n):
  me1,me2=list(map(int,input().split()))
  if me1==me2:
    count+=1
    if count==3:
      break
  else:
    count=0
if count>=3:
  print('Yes')
else:
  print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
num_of_double = 0

for i in range(n):
    d1, d2 = map(int,input().split())

    if d1 == d2:
        num_of_double += 1

if num_of_double >= 3:
    print("Yes")
else:
    print("No")

Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
10 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
count = 0
flag = 0

for i in range(n):
    d1, d2 = map(int,input().split())

    if d1 == d2 :
        count += 1
    else:
        count = 0

    if count == 3:
        flag = 1


if flag == 1:
    print("Yes")
else:
    print("No")

Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a,b = map(int,input().split())
c,d = map(int,input().split())
flag = 0
for i in range(n-2):
  e,f = map(int,input().split())
  if a == b and c == d and e == f:
    flag = 1
    break
  a,b = c,d
  c,d = e,f
if flag == 0:
  print("NO")
else:
  print("YES")

Failing test case input:
5
0 -1
1 0
4 0
1 2
1 4

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input().strip())
a,b = map(int,input().strip().split())
c,d = map(int,input().strip().split())
flag = 0
for i in range(n-2):
  e,f = map(int,input().strip().split())
  if a == b and c == d and e == f:
    flag = 1
  a,b = c,d
  c,d = e,f
if flag == 0:
  print("No")
else:
  print("Yes")
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
counter  = 0
value = False
for i in range(n):
    a,b = map(int, input().split())
    if i == 0:
        if a == b:
            counter+=1
            value = True
    else:
        if a == b and value == True:
            counter+=1
            value = True
        elif a == b and value == False:
            counter = 1
            value = True
        else:
            value = False

if counter >= 3:
    print("Yes")
else:
    print("No")

Failing test case input:
6
1 0
2 2
3 3
4 4
5 0
10 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
counter = 0
coutlist = []
value = False
for i in range(n):
    a,b = map(int, input().split())
    if i == 0:
        if a == b:
            counter+=1
            coutlist.append(counter)
            value = True
    else:
        if a == b and value == True:
            counter+=1
            value = True
            coutlist.append(counter)
        elif a == b and value == False:
            counter = 1
            value = True
            coutlist.append(counter)
        else:
            counter = 0
            value = False
            coutlist.append(counter)

if max(coutlist) >= 3:
    print("Yes")
else:
    print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
sub_yes = 0
max_yes = 0
for i in range(N):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        sub_yes += 1
    else:
        if sub_yes > max_yes:
            max_yes = sub_yes
        sub_yes = 0

if sub_yes > max_yes:
    max_yes = sub_yes
if max_yes >= 3:
    print("yes")
else:
    print("no")

Failing test case input:
5
1 -1
8 4
4 0
6 1
3 3

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
N = int(input())
sub_yes = 0
max_yes = 0
for i in range(N):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        sub_yes += 1
        if sub_yes > max_yes:
            max_yes = sub_yes
    else:
        if sub_yes > max_yes:
            max_yes = sub_yes
        sub_yes = 0
if max_yes >= 3:
    print("Yes")
else:
    print("No")

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
count = 0
temp = 0

for _ in range(N):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
    else:
        if temp < count:
            temp = count

        count = 0

if temp >= 3:
    print('Yes')
else:
    print('No')


Failing test case input:
5
1 2
6 6
4 4
3 3
3 3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
count = 0
flag = False

for _ in range(N):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
        if count == 3:
            flag = True

    else:
        count = 0

if flag == True:
    print('Yes')
else:
    print('No')
Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

count = 0
ans = 0
for i in range(n):
    s = input().split()
    
    if s[0]==s[1]:
        count += 1
        
        if count >= 3:
            ans = 1
if ans == 1:
    print('Yes')
else:
    print('No')

Failing test case input:
5
1 1
2 2
3 4
5 5
6 6

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())

count = 0
ans = 0
for i in range(n):
    s = input().split()
    
    if s[0]==s[1]:
        count += 1
    else:
        count = 0
        
    if count ==3:
        print('Yes')
        exit(0)

else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
cnt = 0
is_ok = False
for _ in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        cnt += 1
    else:
        cnt = 1
    if cnt >= 3:
        is_ok = True
    else:
        pass
if is_ok:
    print('Yes')
else:
    print('No')


Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
10 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
cnt = 0
is_ok = False
for _ in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        cnt += 1
    else:
        cnt = 0
    if cnt >= 3:
        is_ok = True
    else:
        pass
if is_ok:
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = int(input())
count = 0
for i in range(a):
    a,b = map(int,input().split())
    
    if (a==b):
        count += 1
    else : 
        count = 0

if (count >= 3):
        
    print("Yes")
else :
    print("No")


Failing test case input:
6
1 0
2 2
3 3
4 4
5 5
10 6

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
c = int(input())
count = 0

d = [list(map(int,input().split())) for i in range(c)]
for i in range(c):
    a,b = d[i][0],d[i][1]
    
    if (a==b):
        count += 1
        if ( count == 3):
            break
    else : 
        count = 0

if (count >= 3):
        
    print("Yes")
else :
    print("No")
Problem: p02547
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
Count = 0
Array = []
for i in range(int(input())):
    Dice_1, Dice_2 = map(int, input().split())
    if Dice_1 == Dice_2:
        Array.append(1)
    else:
        Array.append(0)

ans = []
j_1 = 0
for j in range(len(Array)):
    if j_1 == 1 and Array[j] == 1:
        Count = Count + 1
    else:
        Count = 0
    j_1 = Array[j]
    print(Count)
    ans.append(Count)
print(max(ans))
if max(ans) >= 2:
    print('Yes')
else:
    print('No')

Failing test case input:
6
-2 1
1 3
0 1
4 12
2 0
0 2

Expected output:
No


Actual output:
0
0
0
0
0
0
0
No


Fixed submission (verdict: Accepted):
Count = 0
Array = []
for i in range(int(input())):
    Dice_1, Dice_2 = map(int, input().split())
    if Dice_1 == Dice_2:
        Array.append(1)
    else:
        Array.append(0)

ans = []
j_1 = 0
for j in range(len(Array)):
    if j_1 == 1 and Array[j] == 1:
        Count = Count + 1
    else:
        Count = 0
    j_1 = Array[j]
    ans.append(Count)
if max(ans) >= 2:
    print('Yes')
else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
c, d = [], []
for i in range(n):
    a, b = [int(i) for i in input().split()]
    c.append(a)
    d.append(b)

count = 1

for i in range(0, n):
    if c[i] == d[i]:
        count += 1
    else:
        count = 1
    if count == 3:
        break

if count == 3:
    print('Yes')

else:
    print('No')


Failing test case input:
5
1 2
2 2
4 4
9 5
0 6

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
c, d = [], []
for i in range(n):
    a, b = [int(i) for i in input().split()]
    c.append(a)
    d.append(b)

count = 0

for i in range(0, n):
    if c[i] == d[i]:
        count += 1
    else:
        count = 0
    if count == 3:
        break

if count == 3:
    print('Yes')

else:
    print('No')

Problem: p02547
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
lst = []
for _ in range(N):
  d1, d2 = map(int, input().split(' '))
  lst.append((d1, d2))
  
idx = 0
flag = False
while idx < N-2:
  cnt = 0
  for _ in range(3):
    d1, d2 = lst[idx]
    if d1 == d2:
      cnt += 1
  if cnt == 3:
    flag = True
    break
  else:
    idx += 1

print('Yes' if flag else 'No')

Failing test case input:
6
1 0
2 3
3 3
4 4
5 0
8 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
lst = []
for _ in range(N):
  d1, d2 = map(int, input().split(' '))
  lst.append((d1, d2))
  
idx = 0
flag = False
while idx < N-2:
  cnt = 0
  for i in range(3):
    d1, d2 = lst[i+idx]
    if d1 == d2:
      cnt += 1
  if cnt == 3:
    flag = True
    break
  else:
    idx += 1
 
print('Yes' if flag else 'No')