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):
n = int(input())
d = [list(map(int, input().split()))for _ in range(n)]
​
cnt = 0
for i, (p, q) in enumerate(d):
    if p == q:
        cnt += 1
    else:
        cnt = 0
    if cnt == 3:        
        print("Yes")
        break
else:
    print("No")
5

n = int(input())
d = [list(map(int, input().split()))for _ in range(n)]
​
cnt = 0
for i, (p, q) in enumerate(d):
    if p == q:
        cnt += 1
    else:
        cnt = 0
    if cnt == 3:        
        print("Yes")
        break
else:
    print("No")


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

cnt = 0
for i, (p, q) in enumerate(d):
    if p == q:
        cnt += 1
    else:
        cnt = 0
    if cnt == 3:
        print("Yes")
        break
else:
    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())
D = [list(map(int, input().split())) for _ in range(N)]
i = 0
count = 0
while i < N:
    if D[i][0] == D[i][1]:
        count += 1
    else:
        count = 0
    i += 1

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

N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]
i = 0
count = 0
while i < N:
    if D[i][0] == D[i][1]:
        count += 1
    else:
        count = 0
    i += 1

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


N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]
count = 0
for i in range(N-2):
    if D[i][0]==D[i][1] and D[i+1][0]==D[i+1][1] and D[i+2][0]==D[i+2][1]:
        print("Yes")
        exit()

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())
data = []
zoro = []
yn = False
for i in range(n):
    data = input().split()
    if data[0] == data[1]:
        zoro += [True]
    else:
        zoro += [False]
    if i > 1 and (zoro[i] == True or zoro[i-1] == True or zoro[i-2] == True):
        yn = True
print(zoro)
print("Yes") if yn == True else print("No")

n = int(input())
data = []
zoro = []
yn = False
for i in range(n):
    data = input().split()
    if data[0] == data[1]:
        zoro += [True]
    else:
        zoro += [False]
    if i > 1 and (zoro[i] == True and zoro[i-1] == True and zoro[i-2] == True):
        yn = True
print("Yes") if yn == True 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):
print('NYoe s'[[0]*3in[eval(t.replace(*' -'))for t in open(0)]::2])

print('NYoe s'[[*'111']in[str(len({*t.split()}))for t in open(0)][1:]::2])

print('NYoe s'[[*'000']in[str(eval(t.replace(*' -')))for t in open(0)]::2])

print('NYoe s'[[*'000']in[eval(t.replace(*' -'))for t in open(0)]::2])

print('NYoe s'[[*'000']in[eval(eval(t.replace(*' -')))for t in open(0)]::2])

print('NYoe s'['111'in''.join(str(len({*t.split()}))for t in open(0))[1:]::2])

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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
for i in range(n):
    a,b = map(int,input().split())
    if a==b:
        count += 1
    else:
        count = 0
print('Yes' if count > 2 else 'No')


n = int(input())
count = 0
for i in range(n):
    a,b = map(int,input().split())
    if count >2 :
        break
    elif a==b:
        count += 1
    else:
        count = 0
print('Yes' if count > 2 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())
count = 0
for i in range(N-1):
  s = list(map(int, input().split()))
  if s[0] == s[1]:
    count += 1
if count >= 3:
  print("Yes")
else:
  print("No")

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


  


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


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):
def divisor(n): 
    i = 1
    count = 0
    while i * i < n:
        if n%i == 0:
           count += 2
        i += 1
    if i * i == n:
    	count =+ 1
    return count
    
n = int(input())

count = 0
for num in range(n):
	count += divisor(num)
print(count)

n = int(input())
numList = []
for x in range(n):
	num = [int(x) for x in input().split()]
	if num[0] == num[1]:
		numList.append('True')
	else:
		numList.append('False')
		
	
judge = 'No'
for x in range(len(numList)-2):
    if numList[x] == 'True':
      if numList[x+1] == 'True':
        if numList[x+2] == 'True':
          judge = 'Yes'
print(judge)


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

flag = 0
ans = 0

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

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

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

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):
count = 0
for i in range(int(input())):
    l = list(map(int, input().split()))
    if l[0] == l[1]:
        count += 1
    elif l[0] != l[1]:
        count = 0
if count >= 3:
    print("Yes")
elif count < 3:
    print("No")


count = 0
for i in range(int(input())):
    l = list(map(int, input().split()))
    if l[0] == l[1]:
        count += 1
    elif l[0] != l[1]:
        count = 0
if count >= 3:
    print("Yes")
else:
    print("No")

count = 0
for i in range(int(input())):
    l = list(map(int, input().split()))
    if l[0] == l[1]:
        count += 1
    elif l[0] != l[1]:
        count = 0
    if count >= 3:
        print("Yes")
        break
if count < 3:
    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())
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')

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>=n:
  print('Yes')
else:
  print('No')

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

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())
lst = []
for i in range(n):
	lst.append(list(map(int,input().split())))
print(lst)

cnt = 0

for i in range(n):
	if lst[i][0]==lst[i][1]:
		cnt += 1
	else:
		cnt = 0
	if cnt == 3:
		print('Yes')
		exit()
print('No')

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

cnt = 0

for i in range(n):
	if lst[i][0]==lst[i][1]:
		cnt += 1
	else:
		cnt = 0
	if cnt == 3:
		print('Yes')
		exit()
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 = []
for a in range(N):
  ci = []
  ci.append(int(input()))
  ci.append(int(input()))
  nums.append(ci)

zoro = maximum = 0
for a in range(N):
  if nums[a][0] == nums[a][1]:
    zoro += 1
    maximum = max(maximum, zoro)
  else:
    zoro = 0

N = int(input())

info = []
for i in range(N):
    chis = input().split()
    info.append(chis)

maximum = zoro = 0
for each in info:
    if each[0] == each[1]:
        zoro += 1
        maximum = max(maximum, zoro)
    else:
        zoro = 0

if maximum > 2:
    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())
count = 0
flag = False
for i in range(n):
    a, b = map(int, input().split())
    if a == b:
        if count == 2:
            flag = True
        else:
            count += 1
    else:
        count = 0
if flag:
    print(Yes)
else:
    print("No")

n = int(input())
count = 0
flag = False
for i in range(n):
    a, b = map(int, input().split())
    if a == b:
        if count == 2:
            flag = True
        else:
            count += 1
    else:
        count = 0
if flag:
    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())
d = []
z = 0

for i in range(n):
  d1, d2 = map(int, input().split())
  z = z+1 if d1==d2 else 0
  d.append(z)

print(max(d))

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

for i in range(n):
  d1, d2 = map(int, input().split())
  z = z+1 if d1==d2 else 0
  d.append(z)

ans = 'Yes' if max(d)>=3 else 'No'
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())
ct = 0
for i in range(N):
    s,g = map(int,input().split())
    if s == g:
        ct += 1
    else:
        ct = 0
    if ct == 3:
        print("yes")
        break
else:
    print("No")

N = int(input())
ct = 0
flg = 0
for i in range(N):
    s,g = map(int,input().split())
    if s == g:
        ct += 1
    else:
        ct = 0
    if ct == 3:
        flg = 1

print(("No","Yes")[flg == 1])

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):
x=int(input())
count=0
for a in range(x):
  b=input().split(' ')
  if int(b[0])==int(b[1]):
    count+=1
  else:
    count=0
  if count==3:
    break
if count==3:
  print('yes')
else:
  print('no')

x=int(input())
count=0
for a in range(x):
  b=input().split(' ')
  if int(b[0])==int(b[1]):
    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):
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')


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


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


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


Verdicts: 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 = str(input())

count = 0
yes = False

for i in range(N):
  a , b = map(int, input().split())
  
  if a==b:
    count +=1
    if count >= 3:
      print("Yes")
      yes = True
      break
  else:
    count = 0

if !yes:
  print("No")

N = str(input())

count = 0
yes = False

for i in range(N):
  a , b = map(int, input().split())
  
  if a==b:
    count +=1
    if count >= 3:
      print("Yes")
      yes = True
      break
  else:
    count = 0

if not(yes):
  print("No")

N = int(input())

count = 0
yes = False

for i in range(N):
  a , b = map(int, input().split())
  
  if a==b:
    count +=1
    if count >= 3:
      print("Yes")
      yes = True
      break
  else:
    count = 0

if not(yes):
  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())
for i in range(n):
  d = map(int, input().split())


answer = 'No'

count = 0
for i in range(n):
    if d[i][0] != d[i][1]:
        count = 0
    else:
        count += 1

    if count == 3:
        answer = 'Yes'
        break

print(answer)


def judge():
    cnt = 0  
    for _ in range(N):
        x, y = map(int, input().split())
        if x == y:
            cnt += 1
        else:
            cnt = 0
        if cnt == 3:
            return True
    return False

N = int(input())

if judge():  
    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):
dice_num_list = []
equal_index_list = []

N = int(input())

for i in range(1, N + 1):
    d1, d2 = input().split(" ")
    dice_num_list.append([d1, d2])

equal_index_list = [i for i, x in enumerate(dice_num_list) if x[0] == x[1]]

if len(equal_index_list) < 3:
    print('No')
    exit(0)
for index in equal_index_list:
    if equal_index_list[index + 1] == index + 1 and equal_index_list[index + 2] == index + 2:
        print("Yes")
        exit(0)
print("No")

dice_num_list = []
equal_index_list = []

N = int(input())

for i in range(1, N + 1):
    d1, d2 = input().split(" ")
    dice_num_list.append([d1, d2])

equal_index_list = [i for i, x in enumerate(dice_num_list) if x[0] == x[1]]

l = len(equal_index_list)
if l < 3:
    print('No')
    exit(0)

for i in range(l - 2):
    if equal_index_list[i] + 1 == equal_index_list[i + 1] and equal_index_list[i] + 2 == equal_index_list[i + 2]:
        print("Yes")
        exit(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):
rolls = int(input())
dices = []
for _ in range(rolls):
  dices.append(list(map(int, input().split())))

doubles = [d1 == d2 for d1,d2 in dices]

for i in range(1,rolls):
  doubles[i] *= (doubles[i] + doubles[i-1])
  if double[i] == 3:
    print('Yes')
    exit()

print('No')




rolls = int(input())
dices = []
for _ in range(rolls):
  dices.append(list(map(int, input().split())))
 
doubles = [d1 == d2 for d1,d2 in dices]
 
for i in range(1,rolls):
  doubles[i] *= (doubles[i] + doubles[i-1])
  if doubles[i] == 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())
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")

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

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

Verdicts: Wrong Answer

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=input()
n=int(N)
for s in range(n):
  ds1,ds2=input().split()
if ds1==ds2 and d(s+1)1==d(s+1)2 and d(s+2)1==d(s+2)2:
  print("Yes")
else:
  print("No")

N=input()
n=int(N)
x=0
for s in range(n):
  ds1,ds2=input().split()
  Ds1=int(ds1)
  Ds2=int(ds2)
  if Ds1==Ds2:
    x+=1
  else:
    x+=0
if x>3:
  print("Yes")
else:
  print("No")

N=input()
n=int(N)
x=0
for s in range(n):
  ds1,ds2=input().split()
  if ds1==ds2:
    x+=1
  else:
    x=0
  if x==3:
    print("Yes")
    break
else:
  print("No")

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())
count = 0

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

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


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

n = int(input())
num_of_double = 0

for i in range(n):
    d1 = int(input())
    d2 = int(input())

    if d1 == d2:
        num_of_double += 1

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

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

Verdicts: Wrong Answer

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

i = 0
res = False

for _ in range(N):  
    a, b = map(int,input().split())

    if a == b:
        print("matched")
        i += 1
    else:
        i = 0
        
    if i >= 3:
        res = True

print("Yes" if res else "No")

N = int(input())

i = 0
res = False

for _ in range(N):  
    a, b = map(int,input().split())

    if a == b:
        i += 1
    else:
        i = 0
        
    if i >= 3:
        res = True

print("Yes" if res 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())
ans=0
x=-1
for i in range(n):
    a,b=map(int,input().split())
    if a==b and i==x+1:
        ans+=1
        x=i
        if ans==3:
            x=0
            break
if ans==3:
    print('Yes')
else:
    print('No')

n=int(input())
ans=0
c=[]
x=0
for i in range(n):
    a,b=map(int,input().split())
    if a==b:
        c.append(i)
for i in range(len(c)-2):
    if c[i]==c[i+1]-1 and c[i+1]==c[i+2]-1:
        print('Yes')
        x=1
        break
if x==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())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
a=0
for i in range(n):
  if x[i]==y[i]:
    a+=1
  	if a==3:
      break
  else:
    a=0
    
if a>=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)]
a=0
for i in range(n):
  if x[i]==y[i]:
    a+=1
    if a==3:
      break
  else:
    a=0
    
if a>=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 run(n, _in_list):
    '''
    '''
    is_doublet_count = 0
    for x in _in_list:
        _in = list(x)
        if _in[0] ==_in[1]:
            is_doublet_count += 1
        else:
            is_doublet_count = 0
    
    print('Yes' if is_doublet_count >= 3 else 'No')
    




if __name__ == '__main__':
    n = int(input())
    _in_list = [map(int, input().split()) for _ in range(n)]
    run(n, _in_list)

def run(n, _in_list):
    '''
    '''
    is_doublet_count = 0
    for x in _in_list:
        if is_doublet_count == 3:
            break
        _in = list(x)
        if _in[0] ==_in[1]:
            is_doublet_count += 1
        else:
            is_doublet_count = 0
    
    print('Yes' if is_doublet_count >= 3 else 'No')
    




if __name__ == '__main__':
    n = int(input())
    _in_list = [map(int, input().split()) for _ in range(n)]
    run(n, _in_list)

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 = 'No'
for _ in range(n):
	a,b = map(int,input().split(' '))
    if a!=b:
    	count = 0 
    else:
    	count+=1
    if count ==3:
    	ans = 'Yes'
print(ans)     

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


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

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


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


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


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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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):
cnt = int(input())
chain = 0
first = 0
second = 0

for i in range(cnt):
    nList = list(map(int, input().split()))
    first = nList.pop()
    second = nList.pop()
    if first == second:
        chain = chain + 1
    else:
        chain = 0

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


cnt = int(input())
chain = 0
first = 0
second = 0

for i in range(cnt):
    nList = list(map(int, input().split()))
    first = nList.pop()
    second = nList.pop()
    if first == second:
        chain = chain + 1
        if chain >= 3:
            break
    else:
        chain = 0

if chain >= 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())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
count = 0
total = 0

for _ in range(n):
  total += 1
  if x[n] == y[n]:
    count += 1
    if count == 3:
      print("Yes")
      break
  else:
    count = 0
  if total == n and count < 3:
    print("No")

n = int(input())
count = 0

for _ in range(n):
  d1, d2 = map(int, input().split())
  if d1 == d2:
    count += 1
    if count >= 3:
      print("Yes")
      exit()
  else:
     count = 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 = 0
c1=0
for x in range(n):
  a,b = map(int,input().split())
  if a==b:
    c+=1
    if c==3:
        c1 = 1
      	print('Yes')
      	break
  else:
    c=0
if c1==0:
    print('No')


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

n = int(input())
c = 0
c1=0
for x in range(n):
  a,b = map(int,input().split())
  if a==b:
    c+=1
    if c==3:
        c1 = 1
        print('Yes')
        break
  else:
    c=0
if c1==0:
    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):
def main():
    N = int(input())
    z = 0
    for i in range(N):
        d1, d2 = map(int, input().split())
        if d1 == d2:
            z += 1
        else:
            z = 0
        if z >= 3:
            return True

    return False

# print("Yes" if main() else "No")
print(main())


def main():
    N = int(input())
    z = 0
    for i in range(N):
        d1, d2 = map(int, input().split())
        if d1 == d2:
            z += 1
        else:
            z = 0
        if z >= 3:
            return True

    return False

print("Yes" if main() 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):
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(re<3):
    print("No")
else:
    print("Yes")

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

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())
j=0
for i in range(N):
  D1,D2=map(int,input().split())
  if D1==D2:
    j+=1
  else:
    j=0
if j>=3:
  print('Yes')
else:
  print('No')

N=int(input())
j=0
J=0
for i in range(N):
  D1,D2=map(int,input().split())
  if D1==D2:
    j+=1
    if j>=3:
      J=3
  else:
    j=0
if J>=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
for i in range(N):
    di_1, di_2 = int(input().split())
    if di_1 == di_2:
        count += 1
    else:
        count = 0
if count >= 3:
    print("Yes")
else:
    print("No")

N = int(input())
count = 0
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 = 0
if count >= 3:
    print("Yes")
else:
    print("No")

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

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

Verdicts: Runtime Error

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())
l = [list(map(int, input().split())) for l in range(N)]

last = 0
for item in l:
  if last == 0 and l[0] == l[1]:
    last = 1
  if last == 1 and l[0] == l[1]:
    last = 2
  if last == 2 and l[0] == l[1]:
    last = 3
    break
  last == 0

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

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

last = 0
for item in l:
  if last == 0 and l[0] == l[1]:
    last = 1
  if last == 1 and l[0] == l[1]:
    last == 2
  if last == 2 and l[0] == l[1]:
    last == 3
    break
  last == 0

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

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

last = 0
for item in l:
  if last == 0 and l[0] == l[1]:
    last = 1
  elif last == 1 and l[0] == l[1]:
    last = 2
  elif last == 2 and l[0] == l[1]:
    last = 3
    break
  last == 0

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

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

last = 0
for item in l:
  if last == 0 and item[0] == item[1]:
    last = 1
    continue
  elif last == 1 and item[0] == item[1]:
    last = 2
    continue
  elif last == 2 and item[0] == item[1]:
    last = 3
    break
  else:
    last = 0

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

Verdicts: 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())
x = [list(map(int, input().split())) for i in range(N)]
count=0
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]:
     count=count+1
  else:
     count=count
else:
  if count>0 :
    print'Yes'
  else :
    print'No'

N=int(input())
x = [list(map(int, input().split())) for i in range(N)]
count=0
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]:
     count=count+1
  else:
     count=count+0
else:
  if count>0 :
    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())
d = [list(map(int, input().split())) for _ in range(n)]

c = 0
ans = False
for i in d:
    if d[0] == d[1]:
        c += 1
        if c >=3:
            ans = True
            break
    else:
        c = 0
if ans:
    print('Yes')
else:
    print("No")

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

c = 0
ans = False
for i in d:
    if i[0] == i[1]:

        c += 1
        if c >=3:
            ans = True
            break
    else:
        c = 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):
n = int(input())  
num_list = []
for i in range(n):
    num_list.append(list(map(int,input().split())))

ans = []
for i in range(n):
  a = num_list[i]
  a1= a[0]
  a2 = a[1]
  if a1 == a2:
    ans.append(1)
    if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1:
      print('Yes')
      break
  else:
    ans.append(0)
if 0 in ans :
  print('No')

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

ans = []
for i in range(n):
  a = num_list[i]
  a1= a[0]
  a2 = a[1]
  if a1 == a2:
    ans.append(1)
    if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1:
      print('Yes')
      break
  else:
    ans.append(0)
if 0 in ans and len(ans) == n :
  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 = input()

result = False
count = 0

for range(N):
    D1,D2 = map(int,input().split())
    if D1 == D2:
        count += 1
    else:
        count = 0

    if count > 2:
        result = True
        break

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


N = int(input())

result = False
count = 0

for i in range(N):
    D1,D2 = map(int,input().split())
    if D1 == D2:
        count += 1
    else:
        count = 0

    if count > 2:
        result = True
        break

if result:
    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 dice(N):
    for i in range(len(N)-2):
        if N[i][0]==N[i][1] and N[i+1][0]==N[i+1][1] and N[i+2][0]==N[i+2][1]:
            return "Yes"
    return "No"

Number=int(input("N="))
N=[]
for i in range(Number):
    x,y=input().split()
    N.append([int(x), int(y)])
print(dice(N))


def dice(N):
    for i in range(len(N)-2):
        if N[i][0]==N[i][1] and N[i+1][0]==N[i+1][1] and N[i+2][0]==N[i+2][1]:
            return "Yes"
    return "No"

Number=int(input())
N=[]
for i in range(Number):
    x,y=input().split()
    N.append([int(x), int(y)])
print(dice(N))


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 solution(arr):
  count = 0
  for i, val in enumerate(arr):
    if i > 0 and arr[i - 1] == val:
      count += 1
    else:
      count = 0
    if count == 2:
      return 'Yes'
  return 'No'
n = int(input())
arr = []
for _ in range(n):
  arr.append(input())
print(solution(arr)

    def solution(arr):
      count = 0
      for i, val in enumerate(arr):
        if i > 0 and arr[i - 1] == val:
          count += 1
        else:
          count = 0
        if count == 2:
          return 'Yes'
      return 'No'
    n = int(input())
    arr = []
    for _ in range(n):
      arr.append(input())
    print(solution(arr))

def solution(arr):
  count = 0
  for i, val in enumerate(arr):
    if arr[i - 1] == val:
      count += 1
    else:
      count = 0
    if count == 2:
      return 'Yes'
  return 'No'
n = int(input())
arr = []
for _ in range(n):
  arr.append(input())
print(solution(arr))

def solution(arr):
  count = 0
  for i, j in arr:
    if i == j:
      count += 1
    else:
      count = 0
    if count == 3:
      return 'Yes'
  return 'No'
n = int(input())
arr = []
for _ in range(n):
  arr.append([ int(i) for i in input().split()])
print(solution(arr))

Verdicts: Runtime Error

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

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

print("No")

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


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)


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

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

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 = input()
count = []
for i in range(N):
    d1,d2,d3 = input().split()
    if (d1==d2)&(d2==d3):
        print('Yes')
        sys.exit()
    else:
        count.append(0)
if sum(count)==0:
    print('No')

N = input()
count = 0
c = 0
for i in range(N):
    d1,d2,d3 = input().split()
    if (d1==d2)&(d2==d3):
        count+=1
        if count=3:
            c =1
            sys.exit()
    else:
        count=0
if count=1:
    print('Yes')
else:
    print('No')

N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1
            sys.exit()
    else:
        count=0
if count==1:
    print('Yes')
else:
    print('No')

N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1

    else:
        count=0
if c==1:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

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())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans=''
for i in range(n-2):
  if x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]:
    ans='Yes'
  else:
    ans='No'
print(ans)

n=int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans='No'
for i in range(n-2):
  if x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]:
    ans='Yes'
print(ans)

Verdicts: Wrong Answer

Accepted