Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03289 (python)

Fixed submission:
S = input()

alphabets = set(chr(ord('a')+x) for x in range(26))

bl1 = (S[0] == 'A')
bl2 = (S[2:-1].count('C') == 1)
bl3 = (set(S) - set('AC') <= alphabets)

answer = 'AC' if bl1 and bl2 and bl3 else 'WA'
print(answer)

Buggy submission (verdict: Runtime Error):
S = input()
alphabets = set(chr(ord('a')+x) for x in range(26))

f1 = (S[0]=="A")
f2 = (S[2:-1].count("C")==1)
f3 = (set(S)-set("AC")<=alphabets)

answer = 'AC' if bl1 and bl2 and bl3 else 'WA'
print(answer)
Problem p03316 (python)

Fixed submission:
a = int(input())
b = list(str(a))
c = sum(list(map(int,b)))

if a%c==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%sum(list(map(int,list(str(a)))))==0:
  print("Yes")
else:
  print("No")
Problem p03323 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[0]<=8 and a[1]<=8:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
input()
print(sum([bin(i)[::-1].index('1') for i in map(int,input().split())]))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
print("Yay!") if a[0]<=8 and a[1]<=8 else print(":(")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
if a[0]<=8 and a[1]<=8:
  print("Yay!")
else:
  print(":(")
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()

answer = 0
for L in range(N):
  left = S[:L]
  right = S[L:]
  both = set(left) & set(right)
  answer = max(answer, len(both))

print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
a = 0

for L in range(N):
  left = S[:L]
  right = S[L:]
  both = set(left)&set(right)
  answer = max(answer,len(both))

print(answer)
Problem p03339 (python)

Fixed submission:
n = int(input())
s = input()
c = s.count("E")
d = c
for i in s:
  if i == "E":
    d -= 1
  else:
    d += 1
  c = min(c,d)
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
a = s.count("E")
c = a 

for s in S:
  if s=="E":
    c-=1
  else:
    c+=1
  a=min(a,c)

print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
a = s.count("E")
c = a 

for s in S:
  if s=="E":
    c-=1
  else:
    c+=1
  a=min(a,c)

print(a)
Problem p03377 (python)

Fixed submission:
a = list(map(int,input().split()))

if a[2]<a[0]:
  print("NO")
else:
  if a[2]<=a[0]+a[1]:
    print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))

if a[2]<a[0]:
  print("NO")
else:
  if a[2]<=a[0]+a[1]:
    print("YES")
  else:
    print("NO")
Problem p03385 (python)

Fixed submission:
a = input()
b = sorted(a)

if "".join(b) == "abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = sorted(input())

if S==[a,b,c]:
  print("Yes")
else:
  print("No")
Problem p03399 (python)

Fixed submission:
a = [int(input()) for i in range(4)]
print(min(a[0],a[1])+min(a[2],a[3]))

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(4)]
print(min(a[0],a[1])+min(a[2],a[3])
Problem p03407 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[0]+a[1]>=a[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
if a[0]+a[1]>=a[2]:
  print("Yes")
else:
  print("No")
Problem p03455 (python)

Fixed submission:
a = list(map(int,input().split()))
b = a[0]*a[1]

if b%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
b = a[0]*a[1]

if b%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
b = a[0]*a[1]

if b%2==0:
  print("Even")
else:
  print("Odd")
Problem p03457 (python)

Fixed submission:
for i in range(int(input())):
  t,x,y=map(int,input().split())
  if(t+x+y)%2+(t<x+y):
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
for i in range(int(input())):
	t,x,y=map(int,input().split())
	if(t+x+y)%2+(t<x+y):
      print("No")
      exit()
print("Yes")
Problem p03470 (python)

Fixed submission:
a = int(input())
b = [int(input()) for i in range(a)]
c = set(b)
print(len(c))

Buggy submission (verdict: Runtime Error):
N = int(input())
d = set(int(input()) for i in range(N))
print(len(S))
Problem p03478 (python)

Fixed submission:
a = list(map(int,input().split()))
z = 0

for i in range(a[0]+1):
  b = list(str(i))
  c = list(map(int,b))
  d = sum(c)
  if a[1]<=d<=a[2]:
    z+=i
else:
  print(z)

Buggy submission (verdict: Runtime Error):
N,A,B = list(map(int,input().split()))
a = 0

for i in range(N+1):
  S = sum(list(map(int,list(str(i)))))
  if A<=S<=B:
    a+=i

print(z)
Problem p03487 (python)

Fixed submission:
from collections import *
input()
print(sum(v if k>v else v-k for k,v in Counter(map(int,input().split())).items()))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = 10**5*[0]
ans = 0

for a in A:
  if a<=10**5:
    B[a]+=1
  else:
    ans+=1

for n in range(10**5):
  if B[n]<n:
    ans+=B[n]
  elif n<B[n]:
    ans+=B[n]-n

print(ans)
Problem p03493 (python)

Fixed submission:
a = input()
print(a.count("1"))

Buggy submission (verdict: Runtime Error):
print(input().count(1))
Problem p03503 (python)

Fixed submission:
N=int(input())
F=[int(input()[::2],2)for _ in range(N)]
P=[list(map(int,input().split(" "))) for _ in range(N)]
print(max(sum(p[bin(i&f).count("1")]for f,p in zip(F,P))for i in range(1,1024)))

Buggy submission (verdict: Runtime Error):
N=int(input())
F=[int(input()[::2],2)for _ in range(N)]
P=[list(map(int,input().split(" "))) for _ in range(N)]
print(max(sum(p[bin(i&f).count("1")]for f,p in zip(F,P))for i in r(1,1024)))

Buggy submission (verdict: Runtime Error):
N = int(input())
F = [list(map(int,input().split())) for _ in range(N)]
P = [list(map(int,input().split())) for _ in range(N)]
print(max(sum([p[bin(f&i).count('1')]for f,p in zip(F,P)])for i in range(1,1024)))
Problem p03545 (python)

Fixed submission:
A,B,C,D =input()
E ="+-"

for i in E:
  for j in E:
    for k in E:
      s=A+i+B+j+C+k+D
      if eval(s)==7:
        print(s+"=7")
        exit()

Buggy submission (verdict: Runtime Error):
A,B,C,D =input()
E ="+-"

for i in E:
  for j in E:
    for k in E:
      s=A+i+B+j+C+k+D
      if eval(s)==7:
        print(s+"=7")
		exit()

Buggy submission (verdict: Runtime Error):
A,B,C,D =input();
E ="+-"

for i in E:
  for j in E:
    for k in E:
      s=A+i+B+j+C+k+D
      if eval(s)==7:
        print(s+"=7")
		exit()
Problem p03547 (python)

Fixed submission:
a = input().split(" ")
b = {"A":11,"B":12,"C":13,"D":14,"E":15,"F":16}

if b[a[0]] == b[a[1]]:
  print("=")
elif b[a[0]] < b[a[1]]:
  print("<")
else:
  print(">")

Buggy submission (verdict: Runtime Error):
a = input().split(" ")
b = {"A":11,"B":12,"C":13,"D":14,"E":15:"F":16}

if b[a[0]] == b[a[1]]:
  print("=")
elif b[a[0]] < b[a[1]]:
  print("<")
else:
  print(">")
Problem p03555 (python)

Fixed submission:
a = input()
b = input()

if a == b[::-1]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a == b[::-1]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a = b[::-1]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()

if a == b.reverse():
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
if a = b.reverse():
  print("YES")
else:
  print("NO")
Problem p03645 (python)

Fixed submission:
N,M = list(map(int,input().split()))
x = 1
y = 1

for m in range(M):
    a,b = list(map(int,input().split()))
    if a==1:
      x|=1<<b
    if b==N:
      y|=1<<a

print("IM"*(x&y==1)+"POSSIBLE")

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
x = 1
y = 1

for m in M:
    a,b = list(map(int,input().split()))
    if a==1:
      x|=1<<b
    if b==N:
      y|=1<<a

print("IM"*(x&y==1)+"POSSIBLE")
Problem p03657 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
A,B = map(input().split())

if A%3==0 or B%3==0 or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")
Problem p03679 (python)

Fixed submission:
a = list(map(int,input().split()))

if a[1] >= a[2]:
  print("delicious")
else:
  if a[2] - a[1] <= a[0]:
    print("safe")
  else:
    print("dangerous")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [0] + [int(input()) for _ in range(N)]
x = 1
visited = set([1])
answer = 0

while True:
  x = a[x]
  if x in visited:
    answer = -1
    break
  visited.add(x)
  answer += 1
  if x == 2:
    break
    
print(answer)
Problem p03680 (python)

Fixed submission:
N = int(input())
a = [int(input()) for i in range(N)]
now = a[0]
count = 1
c = 0
for i in range(10**6):
    if now != 2:
        count += 1
        now = a[now - 1]
    else:
        print(count)
        c = 1
        break
if c == 0:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [0] + [int(input()) for _ in range(N)]
x = 1
visited = set([1])
answer = 0

while True:
  x = A[x]
  if x in visited:
    answer = -1
    break
  visited.add(x)
  answer += 1
  if x == 2:
    break
    
print(answer)
Problem p03695 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if a<3200]
m = len(set(C))
print(max(1,m),m+N-len(C))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if s<3200]
m = len(set(C))
print(max(1,m),m+N-len(C))
Problem p03711 (python)

Fixed submission:
a = list(map(int,input().split()))
b = [1,3,5,7,8,10,12]
c = [4,6,9,11]
d = [2]
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

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

Buggy submission (verdict: Runtime Error):
H,W = list(map(int,input().split()))
a = [input() for i in range(H)]

for i in range(H+2):
  if i==0 or i==H+1:
    print("#"*(W+2))
  else:
    print("#"+a[i-1]+"#")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = list(1,3,5,7,8,10,12)
c = list(4,6,9,11)
d = list(2)
e = 0

if a[0] in b and a[1] in b:
  e += 1
elif a[0] in c and a[1] in c:
  e += 1

if e == 1:
  print("Yes")
else:
  print("No")
Problem p03720 (python)

Fixed submission:
a = list(map(int,input().split()))
b = [list(map(int,input().split())) for i in range(a[1])]
c = []

for i in range(a[0]):
  d = []
  for j in range(a[1]):
    d.append(b[j].count(i+1))
  else:
    c.append(sum(d))
else:
  for i in range(a[0]):
    print(c[i])

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
z = 0

for i in range(M):
  a,b = list(map(int,input().split()))
  z.append(a)
  z.append(b)

for i in range(N):
  print(z.count(i+1))
Problem p03721 (python)

Fixed submission:
N,K = map(int, input().split())
s = sorted([list(map(int, input().split())) for i in range(N)])
t = 0

while K>0:
    K-=s[t][1]
    t+=1

print(s[t-1][0])

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
ans = ""

for n in range(N):
  a,b = input().split()
  ans+= a*int(b)

print(ans[K-1])
Problem p03760 (python)

Fixed submission:
from math import floor
a = input()
b = input()
c = ""

for i in range(len(a)+len(b)):
  if i%2==0:
    c+=a[floor(0.5*i)]
  else:
    c+=b[floor(0.5*i)]
else:
  print(c)

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
s = ""

for i in range(len(o)+len(e)):
  if i%2==0:
    s+=a[i//2]
  else:
    s+=b[i//2]

print(s)
Problem p03845 (python)

Fixed submission:
a = int(input())
b = list(map(int,input().split()))
c = int(input())

for i in range(c):
  d = list(map(int,input().split()))
  e = b[:]
  e[d[0]-1] = d[1]
  print(sum(e))

Buggy submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())

for i in range(N):
  P,X = list(map(int,input().split()))
  Z = T[:]
  Z[P-1] = X
  print(sum(Z))
Problem p03853 (python)

Fixed submission:
a = list(map(int,input().split()))
for i in range(a[0]):
  b = input()
  print(b)
  print(b)

Buggy submission (verdict: Runtime Error):
H,W = list(int,map(input().split()))
for i in range(H):
  C = input()
  print(C)
  print(C)

Buggy submission (verdict: Runtime Error):
H,W = list(map,int(input().split()))

for i in range(H):
  C = input()
  print(C)
  print(C)
Problem p03860 (python)

Fixed submission:
a = input().split(" ")
print(a[0][0]+a[1][0]+a[2][0])

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print((a[1]-a[0]+1)//a[2])
Problem p03964 (python)

Fixed submission:
N = int(input())
t = 0
a = 0

for _ in range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)

Buggy submission (verdict: Runtime Error):
N = int(input())
t = 0
a = 0

for _iin range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)

Buggy submission (verdict: Runtime Error):
N = int(input())
t = 0
a = 0

for _ in range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1 (a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)
Problem p04011 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())

if a <= b:
  print(a*c)
else:
  print(c*b+d*(a-b))

Buggy submission (verdict: Runtime Error):
a = []
for i in range(4):
  a.append(int(input()))

if a[0] > a[1]:
  print(a[3]*a[1]+a[4]*(a[2]-a[1]))
else:
  print(a[3]*a[1])
Problem p04012 (python)

Fixed submission:
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values():
  if i%2!=0:
    c = 1
else:
  if c==0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values:
  if i%2!=0:
    c = 1
else:
  if c==0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
from collections import Counter
a = input()
b = Counter(a)
c = 0

for i in b.values:
  if i%2!=0:
    c = 1
    break
else:
  if c==0:
    print("Yes")
  else:
    print("No")
Problem p04029 (python)

Fixed submission:
a = int(input())
print(int(0.5*a*(a+1)))

Buggy submission (verdict: Runtime Error):
N = int(input())
print(N*(N-1)///2)
Problem p04030 (python)

Fixed submission:
a = input()
b = []

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  elif s=="B" and len(b)!=0:
    b.pop()
else:
  print("".join(b))

Buggy submission (verdict: Runtime Error):
s = input()
z = []

for i in s:
  if i=="B":
    z.pop()
  else:
    z.append(i)

print("".join(z))

Buggy submission (verdict: Runtime Error):
a = input()
b = []

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  else:
    b.pop()
else:
  print("".join(b))
Problem p04044 (python)

Fixed submission:
a = list(map(int,input().split()))
b = [input() for i in range(a[0])]
c = sorted(b)
print("".join(c))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = [input() for i in range(a[1])]
c = sorted(b)
print(c)
Problem p02582 (python)

Fixed submission:
ss=input()
if ss[0] == ss[1] ==ss[2] == "R":
  print(3)
elif ss[0] == ss[1] == "R" or ss[1]==ss[2] == "R":
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
ss=input()
if ss[0] == ss[1] ==s[2] == "R":
  print(3)
elif ss[0] == s[1] == "R" or ss[1]==ss[2] == "R" or ss[2] == ss[0] == "R"
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
ss=input()
if ss[0] == ss[1] ==s[2] = "R":
  print(3)
elif ss[0] == s[1] = "R" or ss[1]==ss[2] = "R" or ss[2] == ss[0] = "R"
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000 and i !== 0:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
    if i == 0:
        print(0)
        ans = -1
        break
    elif ans > 1000000000000000000 and i !== 0:
        print(-1)
        ans = -1
        break
if ans != -1:
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
    if ans > 1000000000000000000:
        print(-1)
        ans = -1
        break
if ans != -1
    print(ans)
Problem p02678 (python)

Fixed submission:
import queue
N,M = map(int,input().split())
adj = [[]for i in range(N+1)]
parent = [-1] * (N+1) # -1なら未訪問
for m in range(M):
    a,b = map(int,input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue() # 自分の部屋番号、親の部屋番号
q.put((1,0)) # 部屋1の親は部屋0と考える
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1: # 訪問済み
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1: # 未訪問なら
            q.put((next,x)) # 探索候補に追加
print ('Yes') # 必ず目標は達成できる
for p in parent[2:]: # 部屋2以降の親（前の部屋）
    print(p)

Buggy submission (verdict: Runtime Error):
import queue
N, M = map(int, input().split())
adj = [[] for i in range(N+1)]
parent = [-1] * (N+1)
for m in range(N):
    a, b  = map(int, input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue()
q.put((1,0))
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1:
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1:
            q.put((next, x))
print("Yes")
for p in parent[2:]:
    print(p)

Buggy submission (verdict: Runtime Error):
import queue
N, M = map(int, input().split())
adj = [[] for i in range(N+1)]
parent = [-1] * (N+1)
for m in range(N):
    a, b  = mpa(int, input().split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue()
q.put((1,0))
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1:
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1:
            q.put((next, x))
print("Yes")
for p in parent[2:]:
    print(p)
Problem p02718 (python)

Fixed submission:
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
if A[m-1] >= sum(A)/4/m:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
if A[m] > sum(A)/4/m:
    print("Yes")
else:
    print("No")
Problem p02743 (python)

Fixed submission:
import math as mt
a, b, c = map(int, input().split())
d = c - a - b
if d>0 and d**2 > 4*a*b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math as mt
a, b, c = map(double, input().split())
if a + b + 2*mt.sqrt(a*b) < c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math as mt
a, b, c = map(int, input().split())
if a**2 + b**2 + 2*mt.sqrt(a*b) < c**2
  print("Yes")
else:
  print("No")
Problem p02760 (python)

Fixed submission:
a = []
for i in range(3):
    a.append(list(map(int, input().split())))

n = int(input())
for i in range(n):
    b = int(input())
    for j in a:
        if b in j:
            a[a.index(j)][j.index(b)] = 0

ans = 0
for i in range(3):
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = 1
    elif a[i][0] == a[i][1] == a[i][2] == 0:
        ans = 1
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = 1
if a[0][2] == a[1][1] == a[2][0] == 0:
    ans = 1

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

Buggy submission (verdict: Runtime Error):
a = []
for i in range(3):
    a.append(list(map(int, input().split())))

n = int(input())
for i in range(n):
    b = int(input())
    for j in a:
        if b in j:
            a[a.index(j)][j.index(b)] = 0

ans = 0
for i in range(3):
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = 1
    elif a[i][0] == a[i][1] == a[i][2] == 0:
        ans = 1
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = 1
if a[0][3] == a[1][1] == a[2][0] == 0:
    ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")
Problem p02910 (python)

Fixed submission:
ss = input()
count = 0
ans  = 0
for s in ss:
    if count%2 == 0 and s != "L":
        pass
    elif count%2 == 0:
        ans += 1
    elif count%2 == 1 and s != "R":
        pass
    elif count%2 == 1:
        ans += 1
    count += 1
if ans == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
n = len(S)//2
i = 0

if len(S)%2 == 0:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n:
        print("Yes")
else:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n and S[2*i] != "L":
        print("Yes")
    else if i ==n:
        print("No")

Buggy submission (verdict: Runtime Error):
S = input()

n = len(S)//2
i = 0
T = "True"

while i<=n:
    if S[i] is not "L" and S[i+1] is not "R":
        i = i + 2
    else:
        print("No")
        T = "False"
        break

if T == "True":
    print("Yes")
else:
    pass
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))
ll = [t-h*0.006-a for h in hl]
ans = 1
dd = 1000000000
for i in range(n):
    if ll[i] >= 0 and ll[i] < dd:
        ans = i+1
        dd = ll[i]
    elif ll[i] < 0 and -ll[i] < dd:
        ans = i+1
        dd = -ll[i]
    else:
        pass

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))
count = 1
ss = 1000000000
ans = 0
for h in hl:
    if t-h*0.006-a >= 0:
        if float(t-h*0.006-a) < ss:
            ans = count
            count+=1
        else:
            count+=1
    else:
        if float(-t+h*0.006+a) > -ss:
            ans = count
            count+=1
            count+=1
        else:

print(ans)
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

if k == 1:
    print(int(s[0]))
elif s[0] == "1":
    cnt = 0
    while  cnt < len(s) and s[cnt] == "1" :
        cnt += 1
    if cnt >= k:
        print(1)
    elif cnt == len(s):
        print("1")
    else:
        print(s[cnt])
else:
    print(int(s[0]))

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if k == 1:
    print(int(s[0]))
elif s[0] == "1":
    cnt = 0
    while  s[cnt] == "1":
        cnt += 1
    if cnt >= k:
        print(1)
    else:
        print(s[cnt])
else:
    print(int(s[0]))
Problem p03352 (python)

Fixed submission:
import math
x = int(input())
i = 1

def expo(x,i):
    while x % i == 0:
        x = x//i
    if x == 1:
        return True
    else:
        return False

if x > 4:
    while x >1:
        for j in range(2,int(math.sqrt(x))+1):
            if expo(x, j) == True:
                print(x)
                break
        if expo(x,j) == True:
            break
        else:
            x -= 1
else:
    print(1)

Buggy submission (verdict: Runtime Error):
import math
x = int(input())
i = 1

def expo(x,i):
    while x % i == 0:
        x = x//i
    if x == 1:
        return True
    else:
        return False

while x >= 1:
    for j in range(2,int(math.sqrt(x))+1):
        if expo(x, j) == True:
            print(x)
            break
    if expo(x,j) == True:
        break
    else:
        x -= 1