TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
    doubletCount = 0
    cases = int(input())
    for roll in range(cases):
        d1, d2 = map(int, input().split())
        if d1 == d2:
            doubletCount += 1
        else:
            doubletCount = 0
            
        if doubletCount >= 3:
            print("Yes")
            break
        
        if roll == cases - 1:
            print("No")

doubletCount = 0
cases = int(input())
for roll in range(cases):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        doubletCount += 1
    else:
        doubletCount = 0
                
    if doubletCount >= 3:
        print("Yes")
        break
            
    if roll == cases - 1:
        print("No")

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
S = []
for _ in range(N):
  S.append(input().split())
G = []
for i in range(N):
  if S[i][0] == S[i][1]:
    G.append("1")
  else:
    G.append("0")

AN = (''.join(G))

if "111" in AN:
  print("Yes")
else:
  print("No")

N = int(input())
S = []
for j in range(N):
  S.append(input().split())
G = []
for i in range(N):
  if S[i][0] == S[i][1]:
    G.append("1")
  else:
    G.append("0")

AN = (''.join(G))

if "111" in AN:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
num = input()
d = []
for n in range(num):
    t, s = input().split()
    d.append([t,s])
flag = 0
for n in range(num):
    if(n<num-2):
        if(d[n][0]==d[n][1] and d[n+1][0]==d[n+1][1] and d[n+2][0]==d[n+2][1]):
            flag = 1
if flag == 1:
    print('Yes')
else:
    print('No')

num = input()
d = []
num = int(num)
for n in range(num):
    t, s = input().split()
    d.append([t,s])
flag = 0
for n in range(num):
    if(n<num-2):
        if(d[n][0]==d[n][1] and d[n+1][0]==d[n+1][1] and d[n+2][0]==d[n+2][1]):
            flag = 1
if flag == 1:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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
    print(counter)

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

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")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N = int(input())

count = 0
flag = 0

for i in range(N):
  N,M = map(int, input().split())
  if N == M:
    count += 1
  else:
    count = 0
  if count >= 3:
    flag = 1
   
if flag == 1:
  print("yes")
else:
  print("no")

N = int(input())

count = 0
flag = 0

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

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
s = 0
for i in range(n):
  a, b = map(int, input().split())
  if a == b:
    s += 1
  else:
    s = 0
print("Yes" if s >= 3 else "No")

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

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
f=[]
for x in l:
	f.append(x[0]==x[1])
l=f.copy()
i=0
while i<n:
	j=0
	while i+j<n and l[i+j]==l[i] and l[i]:
		j+=1 
	if j>2:
		print('Yes')
		break	
	i+=j
else:
	print('No')
	

n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
f=[]
for x in l:
	f.append(x[0]==x[1])
l=f.copy()
i=0
while i<n:
	j=1
	while i+j<n and l[i+j]==l[i] and l[i]:
		j+=1 
	if j>2:
		print('Yes')
		break	
	i+=j
else:
	print('No')
	

Verdicts: Time Limit Exceeded

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
total = 0

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

n = int(input())
total = 0

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

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
def main():
    N = int(input())
    zoro = 0
    for _ in range(N):
        d1 , d2 = map(int,input().split())
        if d1 == d2:
            zoro += 1
        else:
            zoro = 0
        if zoro > 2:
            print("yes")
            return
    print("No")

if __name__ == '__main__':
    main()


def main():
    N = int(input())
    zoro = 0
    dice = []
    for _ in range(N):
        dice.append(list(map(int, input().split())))

    
    for d1, d2 in dice:
        if d1 == d2:
            zoro += 1
        else:
            zoro = 0
        if zoro > 2:
            break
    
    ans = "Yes" if zoro > 2 else "No"
    print(ans)

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
lst1=[]
lst2=[]
count=0
for _ in range(n):
    m,k=[int(x) for x in input().split()]
    lst1.append(m)
    lst2.append(k)
if(n<3):
    print('NO')
else:
    
    for i in range(n-2):
        if(lst1[i]==lst2[i] and lst1[i+1]==lst2[i+1] and lst1[i+2]==lst2[i+2]):
            count=3
            break
    if(count>=3):
        print('YES')
    else:
        print('NO')
    

n=int(input())
lst1=[]
lst2=[]
count=0
for _ in range(n):
    m,k=[int(x) for x in input().split()]
    lst1.append(m)
    lst2.append(k)
if(n<3):
    print('NO')
else:
    
    for i in range(n-2):
        if(lst1[i]==lst2[i] and lst1[i+1]==lst2[i+1] and lst1[i+2]==lst2[i+2]):
            count=3
            break
    if(count==3):
        print('YES')
    else:
        print('NO')
    

n=int(input())
lst1=[]
lst2=[]
count=0
for _ in range(n):
    m,k=[int(x) for x in input().split()]
    lst1.append(m)
    lst2.append(k)
for i in range(n-2):
    if(lst1[i]==lst2[i] and lst1[i+1]==lst2[i+1] and lst1[i+2]==lst2[i+2]):
        count=3
        break
if(count==3):
    print('Yes')
else:
    print('No')
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N = int(input())
num = 0
for i in range(N):
  D = list(map(int, input().split(' ')))
  if D[0] == D[1]:
    num += 1
  else:
    num = 0

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


N = int(input())
num = 0
ans = False
for i in range(N):
  D = list(map(int, input().split(' ')))
  if D[0] == D[1]:
    num += 1
    if num >= 3:
      ans = True
  else:
    num = 0

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


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
import sys
si=sys.stdin.readline

n=int(si())
t=0
while n:
  n-=1
  a,b=[int(e) for e in si().split()]
  if a==b:
    t+=1
  else:
    t=0
if t>=3:
  print('Yes')
else:
  print('No')
  

import sys
si = sys.stdin.readline

n = int(si())
t = 0
flag = False
while n:
    n -= 1
    a, b = [int(e) for e in si().split()]
    if a == b:
        t += 1
    else:
        t = 0
    if t >= 3:
        flag = True
if flag:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N=int(input())
x = [list(map(int, input().split())) for i in range(N)]
A="NO"
for n in range(N-2):
    if x[n][0]==x[n][1] and x[n+1][0]==x[n+1][1] and x[n+2][0]==x[n+2][1]:
        A="YES"
        break
print(A)

N=int(input())
x = [list(map(int, input().split())) for i in range(N)]
A="NO"
for n in range(N-2):
    if x[n][0]==x[n][1] and x[n+1][0]==x[n+1][1] and x[n+2][0]==x[n+2][1]:
        A="YES"
        break
print(A)

N=int(input())

X=[]
Y=[]
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
A="NO"
for n in range(N-2):
    if X[n]==Y[n] and X[n+1]==Y[n+1] and X[n+2]==Y[n+2]:
        A="YES"
        break
print(A)

N=int(input())

X=[]
Y=[]
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
    
A="NO"
for n in range(N-2):
    if X[n]==Y[n]:
        if X[n+1]==Y[n+1]:
            if X[n+2]==Y[n+2]:
                A="YES"
                break
            else:
                continue
        else:
            continue
    else:
        continue
print(A)

N=int(input())

X=[]
Y=[]
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
    
A="No"
for n in range(N-2):
    if X[n]==Y[n]:
        if X[n+1]==Y[n+1]:
            if X[n+2]==Y[n+2]:
                A="Yes"
                break
            else:
                continue
        else:
            continue
    else:
        continue
print(A)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N = int(input())
flug = False
cnt = 0
for _ in range(N):
    D1, D2 = list(map(int, input().split())) 
    if D1 == D2:
        cnt += 1
    else:
        cnt = 0
    if cnt >= 3:
        flug = True
if flug:
    print("YES")
else:
    print("NO")

N = int(input())
flug = False
cnt = 0
for _ in range(N):
    D1, D2 = list(map(int, input().split())) 
    if D1 == D2:
        cnt += 1
    else:
        cnt = 0
    if cnt >= 3:
        flug = True
if flug:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
k=0
for i in range(n):
  a,b=map(int,input().split())
  if(a==b):
    k+=1
if(k>=3):
  print("YES")
else:
  print("NO")

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")


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")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
ans = 0
for _ in range(n):
  a,b = map(int,input().split())
  if a==b:
    ans += 1
  else:
    ans = 0
print('Yes' if ans>=3 else 'No')

n = int(input())
ans = 0
tmp = 0
for _ in range(n):
  a,b = map(int,input().split())
  if a==b:
    tmp += 1
  else:
    ans = max(ans,tmp)
    tmp = 0
ans = max(ans,tmp)
print('Yes' if ans>=3 else 'No')

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
cnt = 0
for _ in range(n):
  a, b = map(int, input().split())
  if a == b:
    cnt += 1
  else:
    cnt = 0
  
  if cnt == 3:
    print("Yes")
    exit()

print("No")

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

print("No")

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N = int(input())
flag = 0
ans = "No"
for i in range(N):
  A,B = input().split()
  if A == B:    
    flag += 1
  if flag == 3:
    ans = "Yes"
    break
  else:
    flag = 0
    
  
print(ans)

N = int(input())
flag = 0
ans = "No"
for i in range(N):
  A,B = input().split()
  if A == B:    
    flag += 1
  else:
    flag = 0
  if flag == 3:
    ans = "Yes"
    break
    
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 13:06:46 2020

@author: Admin
"""

n=int(input())
l=[]
flag=0
for i in range(n):
    a,b=input().split()
    w=[int(a),int(b)]
    l.append(w)
for i in range(len(l)-2):
    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
        print('yes')
        flag=1
        break
if flag==0:
    print('no')

# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 13:06:46 2020

@author: Admin
"""

n=int(input())
l=[]
flag=0
for i in range(n):
    a,b=input().split()
    w=[int(a),int(b)]
    l.append(w)
for i in range(len(l)-2):
    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
        print('Yes')
        flag=1
        break
if flag==0:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
for i in range(n):
    a,b=list(map(int,input().split()))
for i in range(n-2):
    if a[i]==b[i] and a[i+1]==b[i+1] and a[i+2]==b[i+2]:
        print('Yes')
        exit()
print('No')

n=int(input())
k=0
l=0
for i in range(n):
    a,b=map(int,input().split())
    if a==b:
        k += 1
        if k==3:
            print('Yes')
            exit()
    else:
        k = 0
print('No')

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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(1, n):
    if c[i-1] == c[i] and d[i-1] == d[i]:
        count += 1
    else:
        count = 1
    if count == 3:
        break

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

else:
    print('No')


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')


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
num = int(input())
ans = 0
cnt = 0
for x in range(num):
    d1, d2 = map(int, input().split())
    if d1 == d2: cnt += 1
    else: 
        ans = max(cnt, 2)
        cnt = 0
ans = max(cnt, 2)
if ans >= 3: print("Yes")
else:  print("No")

num = int(input())
ans = 0
cnt = 0
for x in range(num):
    d1, d2 = map(int, input().split())
    if d1 == d2: cnt += 1
    else: 
        ans = max(cnt, ans)
        cnt = 0
ans = max(cnt, ans)
if ans >= 3: print("Yes")
else:  print("No")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
A = list(map(int, input().split()))
N = A[0]
D = A[1:N*2+1]
D1 = []
D2 = []
for i in range(N):
    D1.append(D[2 * i])
    D2.append(D[2 * i + 1])
ans = "No"
for i in range(N - 2):
    if D1[i] == D[i]:
         if D[i + 1] == D[i + 1]:
            if D[i + 2] == D[i + 2]:
                ans = "Yes"
                break
print(ans)

N = int(input())
D = [input().split() for _ in range(N)]
ans = "no"
for i in range(N - 2):
    if D[i][0] == D[i][1]:
         if D[i + 1][0] == D[i + 1][1]:
            if D[i + 2][0] == D[i + 2][1]:
                ans = "yes"
                break
print(ans)

N = int(input())
D = [input().split() for _ in range(N)]
ans = "No"
for i in range(N - 2):
    if D[i][0] == D[i][1]:
         if D[i + 1][0] == D[i + 1][1]:
            if D[i + 2][0] == D[i + 2][1]:
                ans = "Yes"
                break
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
d = []
for i in range(n):
    x = list(map(int, input().split()))
    d.append(x)

d2 = []
ans = "No"

for i in range(n):
    for j in range(2):
        d2.append(d[i][j])

print(d2)

for i in range(0, len(d2)-2):
    if d2[i] == d2[i+1] and d2[i] == d2[i+2]:
        ans = "Yes"
        break

print(ans)

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

d2 = []
ans = "No"

for i in range(n):
    if d[i][0] == d[i][1]:
        d2.append(1)
    else:
        d2.append(0)

for i in range(0, n-2):
    if d2[i] == 1 and d2[i+1] == 1 and d2[i+2] == 1:
        ans = "Yes"
        break

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
count = 0
ans = 0
for i in range(n):
  a,b = map(int, input().split())
  if  a == b:
    count += 1
  else:
    count = 0
  if count >= 3:
    ans = 1
    break
if ans = 1:
  print('Yes')
else:
  print('No')

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


Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N=int(input())
count=0
lst=[]
for i in range(N):
    x,y=map(int,input().split())
    # l=[]
    # l.append(x)
    # l.append(y)
    # lst.append(l)
    if x==y:
        count+=1
    if x!=y:
        break
if count==3:
    print("Yes")
else:
    print("No")

N=int(input())
count=0
l=[]
for i in range(N):
    x,y=map(int,input().split())
    # l=[]
    # l.append(x)
    # l.append(y)
    # lst.append(l)
    if x==y:
        count+=1
    if x!=y:
        l.append(count)
        count=0
if len(l)==0:
    
    l.append(count)
l.sort()
x2=l[-1]
if x2>=3:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
def func(D):
  comb = 0
  for item in D:
    if item[0]==item[1]:
      comb+=1
    else:
      comb=0
    
    if comb==3:
      return "Yes"  
  return "No"

if __name__ == "__main__":
    N = int(input())
    D = [map(int, input().split()) for _ in range(N)]
    print(func(D))

def func(D):
  comb = 0
  for item in D:
    if item[0]==item[1]:
      comb+=1
    else:
      comb=0
    
    if comb==3:
      return "Yes"  
  return "No"

if __name__ == "__main__":
    N = int(input())
    D = [list(map(int, input().split())) for _ in range(N)]
    print(func(D))

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
s=0
for i in range(n):
  lis=input().split()
  if lis[0]==lis[1]:
    s+=1
  else:
    s=0
if s>=3:
  print("Yes")
else:
  print("No")

n=int(input())
s=0
ok=0
for i in range(n):
  lis=input().split()
  if lis[0]==lis[1]:
    s+=1
    if s>=3:
      ok=1
  else:
    s=0
if ok==1:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
num = int(input())

count = 0
flag = False
for i in range(num):
    a,b = read().split()
    if a == b:
        count += 1
        if count >= 3:
            print("Yes")
            flag = True
            break
    else:
        count = 0
if flag:
    print("No")

num = int(input())

count = 0
for i in range(num):
    a,b = read().split()
    if a == b:
        count += 1
        if count >= 3:
            print(Yes)
            return()
    else:
        count = 0
print("No")

num = int(input())

count = 0
flag = False
for i in range(num):
    a,b = input().split()
    if a == b:
        count += 1
        if count >= 3:
            print("Yes")
            flag = True
            break
    else:
        count = 0
if not flag:
    print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
count = 0
a = []

for i in range(n):
  al, be = map(int, input().split())
  if al == be:
    count += 1
    if count >= 3:
      print("Yes")
  else:
    count = 0
else:
  print("No")


n = int(input())
a = []
found = False
count = 0
for i in range(n):
  al, b = map(int, input().split())
  a.append((a, b))
  if found:
    print("Yes")
    break
  if a[i][0] == a[i][1]:
    count += 1
    if count >= 3: # that means that the i is in last 3 numbers
      print("Yes")
      break
  else:
    count = 0
else:
  print("No")


n = int(input())
count = 0

for i in range(n):
    al, be = map(int, input().split())
    if al == be:
        count += 1
        if count >= 3:
            print("Yes")
            break
    else:
        count = 0
else:
    print("No") if count < 3 else print("Yes")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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")

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")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
import sys

n = int(input())
deme = [input().split() for i in range(n)]

#print(deme)

toki = 0

for i in range(n):
  if deme[i][0] == deme[i][1]:
    toki += 1
    if toki >= 3:
      print("YES")
      sys.exit(0)
    
  else:toki = 0

print("NO")

    

import sys

n = int(input())
deme = [input().split() for i in range(n)]

#print(deme)

toki = 0

for i in range(n):
  if deme[i][0] == deme[i][1]:
    toki += 1
    if toki >= 3:
      print("Yes")
      sys.exit(0)
    
  else:toki = 0

print("No")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N = int(input())
nums =[]
count = 0
switch = False
for i in range(N):
    nums.append([int(x) for x in input().split()]

for j in nums:
    if j[0] == j[1]:
        count += 1
    elif j[0] != j[1]:
        count = 0
    if count == 3:
        switch = True
if switch == True:
    print("Yes")
elif switch == False:
    print("No")

N = int(input())
nums =[]
count = 0
switch = False
for i in range(N):
    nums.append([int(x) for x in input().split()])

for j in nums:
    if j[0] == j[1]:
        count += 1
    elif j[0] != j[1]:
        count = 0
    if count == 3:
        switch = True
if switch == True:
    print("Yes")
elif switch == False:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N = int(input())

mulArr = []
for _ in range(N):
  arr = list(map(int, input().split(" ")))
  mulArr.append(arr)
print(mulArr)

result = 0
for i in range(0, len(mulArr) - 2):
  print(i)
  if mulArr[i][0] == mulArr[i][1] and mulArr[i + 1][0] == mulArr[i + 1][1] and mulArr[i + 2][0] == mulArr[i + 2][1]:
    result += 1

print(result)
if result != 0:
  print("Yes")
else:
  print("No")


N = int(input())

mulArr = []
for _ in range(N):
  arr = list(map(int, input().split(" ")))
  mulArr.append(arr)
# print(mulArr)

result = 0
for i in range(0, len(mulArr) - 2):
  # print(i)
  if mulArr[i][0] == mulArr[i][1] and mulArr[i + 1][0] == mulArr[i + 1][1] and mulArr[i + 2][0] == mulArr[i + 2][1]:
    result += 1

# print(result)
if result != 0:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
cnt = 0
zorome = 0
num = input()

while cnt < num:
  mass = input().split()
  
  if(mass[0] == mass[1]):
    zorome += 1
    
    if(zorome >= 3):
      break
  
  cnt += 1

print("Yes" if zorome >= 3 else "No")

cnt = 0
zorome = 0
num = input()

while cnt < num:
  mass = input().split()
  
  if(mass[0] == mass[1]):
    zorome += 1
    
    if(zorome >= 3):
      break
  else:
    zorome = 0
  
  cnt += 1

print("Yes" if zorome >= 3 else "No")


cnt = 0
zorome = 0
num = int(input())

while cnt < num:
  mass = input().split()
  
  if(mass[0] == mass[1]):
    zorome += 1
    
    if(zorome >= 3):
      break
  else:
    zorome = 0
  
  cnt += 1

print("Yes" if zorome >= 3 else "No")




Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
N =int(input())
D = []
for i in range(n):
  D.append([])

for i in range(N):
	for j in range(2):
      	D[i][j]=int(input())

for x in range(N-2):
  	if D[x][1]==D[x][2] and D[x+1][1]==D[x+1][2] and D[x+2][1]==D[x+2][2]:
      	print("Yes")
        break
    else:
      	print("No")


N =int(input())
D = []
for i in range(N):
  d_1,d_2 = map(int,input().split())
  D.append([d_1,d_2])
for x in range(N-2):
  if D[x][0]==D[x][1] and D[x+1][1]==D[x+1][0] and D[x+2][1]==D[x+2][0]:
    print("Yes")
    break
  else:
    print("No")


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)


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)

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)

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)


import sys
N =int(input())
D = []
for i in range(N):
  d_1,d_2 = map(int,input().split())
  D.append([d_1,d_2])
for x in range(N-2):
  if D[x][0]==D[x][1] and D[x+1][1]==D[x+1][0] and D[x+2][1]==D[x+2][0]:
    print("Yes")
    sys.exit()
print("No")


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
t = []
i = 0
for _ in range(n):
    x, y = map(int, input().split())
    if x == y:
        i += 1
    else:
        i = 0
    t.append(i)
if(len(filter(lambda x: x >= 3, t)) == 0):
    print("No")
else:
    print("Yes")


n = int(input())
t = []
i = 0
for _ in range(n):
    x, y = map(int, input().split())
    if x == y:
        i += 1
    else:
        i = 0
    t.append(i)
if(len(list(filter(lambda x: x >= 3, t))) == 0):
    print("No")
else:
    print("Yes")


Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
lis = list(map(int,input().split()))
ans = 0
for i in range(n):
  if lis[i][0] == lis[i][1]:
    ans += 1
  else:
    ans = 0
  if ans == 3:
    print("Yes")
    exit()
print("No")

n = int(input())
lis = [list(map(int,input().split())) for i in range(n)]
ans = 0
for i in range(n):
  if lis[i][0] == lis[i][1]:
    ans += 1
  else:
    ans = 0
  if ans == 3:
    print("Yes")
    exit()
print("No")


Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    ct+=1
    if ct==3:
      print("Yes")
      break
  else:
    ct==0
else:
  print("No")

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

Verdicts: Runtime Error

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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:
    print("Yes")
else:
    print("No")

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")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())
d = []
for i in range(n):
    d.append(list(map(int,input().split())))
row = []
for i in range(n):
    if d[i][0]==d[i][1]:
        row.append(True)
    else:
        row.append(False)
res = False
for i in range(n-2):
    print(row[i:i+3])
    if all(row[i:i+3]):
        res = True
if res:
    print('Yes')
else:
    print('No')

n = int(input())
d = []
for i in range(n):
    d.append(list(map(int,input().split())))
row = []
for i in range(n):
    if d[i][0]==d[i][1]:
        row.append(True)
    else:
        row.append(False)
res = False
for i in range(n-2):
    if all(row[i:i+3]):
        res = True
if res:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n =int(input())
first =[]
second =[]
for i  in range(n):
    d1 , d2 = map(int , input().split())
    first.append(d1)
    second.append(d2)

for i in range(n-2):
    count = 0
    for j in range(i ,i+3):
        if first[j]==second[j]:
            count +=1
        else:
            break
           
    if count ==3:
        print("YES")
        break
    
else:
    print("NO")

n =int(input())
first =[]
second =[]
for i  in range(n):
    d1 , d2 = map(int , input().split())
    first.append(d1)
    second.append(d2)

for i in range(n-2):
    count = 0
    for j in range(i ,i+3):
        if first[j]==second[j]:
            count +=1
        else:
            break
           
    if count ==3:
        print("Yes")
        break
    
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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")

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 -=1
        
if ans >= 3:
    print("Yes")
    
else:
    print("No")

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")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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


# a()
b()
# c()
# d()


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


# a()
b()
# c()
# d()


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n=int(input())
count=0
for i in range(n):
    d1,d2=list(map(int,input().split()))
    if d1==d2:
        count+=1
if count>=3:
    print('YES')
else:
    print('NO')

n=int(input())
count=0
lists=[]
for i in range(n):
    d1,d2=list(map(int,input().split()))
    lists.append([d1,d2])
for i in range(n-2):
    if lists[i][0]==lists[i][1] and lists[i+1][0]==lists[i+1][1] and lists[i+2][0]==lists[i+2][1]:
        print('Yes')
        break
    elif i==n-3:
        print('No')
        break
    else:
        continue


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
n = int(input())

cnt = 0
flg = 0

for i in range(n):
    a, b = map(int, input().split())

    if a == b:
        cnt += 1
        if cnt >= 3:
            flg = 1
    else:
        cnt = 0

    print(cnt)
    print(flg)

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


n = int(input())

cnt = 0
flg = 0

for i in range(n):
    a, b = map(int, input().split())

    if a == b:
        cnt += 1
        if cnt >= 3:
            flg = 1
    else:
        cnt = 0

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


Verdicts: Wrong Answer

Accepted
Problem: Tak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.  Check if doublets occurred at least three times in a row. Specifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.

Submission attempts (in order):
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')
    exit(0)
  elif a == b:
    count += 1
  elif(a != b):
    count = 0
print('No')


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')

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')


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')
    exit(0)
  elif a == b:
    count += 1
  else:
    count = 0
print('No')


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')
    exit(0)
  elif a == b:
    count += 1
  elif(a != b):
    count = 0
if count == 3:
	print('Yes')
else:
	print('No')


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')


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted