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

Fixed submission:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
a=n*x
b=k*x + y*(n-k)
print(a if k >= n else b )

Buggy submission (verdict: Runtime Error):
n,k,x,y=map(int,input().split("\n"))
print(x*n if n <= k else (x*k)+(n-k)*y)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
c = sorted(a,reverse=True)
b = max(a)
if a.count(b)>1:
    for i in range(n):
        print(b)
    exit()
for i in a:
    if i==b:
        print(c[1])
    else:
        print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
c = sorted(a,reverse=True)
if a.count(max(a))>1:
    for i in n:
        print(max(a))
else:
    for i in range(n):
        if i==a.index(max(a)):
            print(c[1])
        else:
            print(max(a))
Problem p02982 (python)

Fixed submission:
import math
n,d = map(int,input().split())
x = [list(map(int,input().split())) for i in range(n)]
cnt = 0
for i in range(n-1):
    for j in range(i+1,n):
        res = 0
        for z in range(d):
            res += (x[i][z]-x[j][z])**2
        if math.sqrt(res)==math.floor(math.sqrt(res)):
            cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
n,d = map(int,input().split())
x = [list(map(int(input().split()))) for i in range(n)]
cnt = 0
for i in range(n-1):
    for j in range(i+1,n):
        res = 0
        for z in range(d):
            res += (x[i][z]-x[j][z])**2
        if math.sqrt(res)**2==res:
            cnt += 1
print(cnt)
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int,input().split())
if x==0 or y==0:
    print("{:.9f}".format(w*h/2),0)
    exit()
if w/x==2.0 and h/y==2.0:
    print(w*h/2,1)
else:
    print(w*h/2,0)

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())
if w/x==2.0 and h//y==2.0:
    print(w*h/2,1)
else:
    print(w*h/2,0)
Problem p03031 (python)

Fixed submission:
n,m = map(int,input().split())
x = [list(map(int,input().split())) for i in range(m)]
p = list(map(int,input().split()))
ans = 0
for i in range(2 ** n):
    bag = []
    cnt = 0
    for j in range(n):  
        if ((i >> j) & 1):  
            bag.append(True)
        else:
            bag.append(False)
    for l in range(m):
        res = 0
        for h in x[l][1:]:
            if bag[h-1]:
                res += 1
        if res%2!=p[l]:
            break
        else:
            cnt += 1
    if cnt==m:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = [list(map(int,input().split())) for i in range(m)]
p = list(map(int,input().split()))
ans = 0
for i in range(2 ** m):
    bag = [0]*n
    cnt = 0
    for j in range(m):  
        if ((i >> j) & 1):  
            bag[j]+=1
    for l in range(m):
        res = 0
        for h in range(1,len(x[l])):
            res += bag[x[l][h]-1]
        if res%2!=p[l]:
            break
        else:
            cnt += 1
    if cnt==m:
        ans += 1
print(ans)
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input())
t = s[k-1]
for i in s:
    if i!=t:
        s = s.replace(i,"*")
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
t = n[k-1]
for i in s:
    if i!=t:
        s.replace(i,"*")
print(s)
Problem p03076 (python)

Fixed submission:
x = [int(input()) for i in range(5)]
a = [0]
res = 0
for i in range(5):
    if x[i]%10!=0:
        a.append(10-x[i]%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)

Buggy submission (verdict: Runtime Error):
x = [int(input()) for i in range(5)]
a = []
res = 0
for i in x:
    if i%10!=0:
        a.append(10-i%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)

Buggy submission (verdict: Runtime Error):
x = [int(input()) for i in range(5)]
a = []
res = 0
for i in range(5):
    if x[i]%10!=0:
        a.append(10-x[i]%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)
Problem p03086 (python)

Fixed submission:
s = input()
res = 0
for i in range(len(s)):
    cnt = 0
    while s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        cnt += 1
        i += 1
        if i==len(s):
          break
    res = max(res,cnt)
print(res)

Buggy submission (verdict: Runtime Error):
s = input()
res = 0
for i in range(len(s)):
    cnt = 0
    while s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        cnt += 1
        i += 1
    res = max(res,cnt)
print(res)
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
s = input()
x = [list(map(int,input().split())) for i in range(q)]
cnt = 0
res = [0]
for i in range(1,len(s)):
    if s[i-1]=="A" and s[i]=="C":
        cnt += 1
    res.append(cnt)
for j in range(q):
    print(res[x[j][1]-1]-res[x[j][0]-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
x = [list(map(int,input().split())) for i in range(q)]
for i in range(q):
    cnt = 0
    t = s[x[i][0]-1:x[i][1]]
    for i in range(len(t)-1):
        if t[i:i+2]=="AC"
            cnt += 1
    print(cnt)
Problem p03146 (python)

Fixed submission:
n = int(input())
cnt = 1
if n>=3:
    cnt = cnt + 1
elif n==2:
    cnt = cnt + 2
else:
    cnt = cnt + 3
while n != 1:
    if n % 2 == 0:
        n /= 2
    else:
        n = 3*n+1
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = 1
if n>=3:
    cnt = cnt + 1
elif n=2:
    cnt = cnt + 2
else:
    cnt = cnt + 3
while n != 1:
    if n % 2 == 0:
        n /= 2
    else:
        n = 3*n+1
    cnt += 1
print(cnt)
Problem p03264 (python)

Fixed submission:
k = int(input())
odd = 0
even = 0
if k%2==0:
    odd = k//2
    even = k//2
else:
    odd = k//2+1
    even = k//2
print(odd*even)

Buggy submission (verdict: Runtime Error):
x,y,z,w = map(int,input().split())
a = z-x
b = w-y
print(str(z-b)+" "+str(w+a)+" "+str(x-b)+" "+str(y+a))

Buggy submission (verdict: Runtime Error):
x,y,z,w = map(int,input().split())
a = z-x
b = w-y
print(str(z-b)+" "+str(w+a)+" "+str(x-b)+" "+str(y+a))
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
ans = "1"
for i in s[:k]:
    if i != "1":
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
ans = "1"
for i in s[:k]:
    if a!= "1":
        ans = a
        exit()
print(ans)
Problem p03424 (python)

Fixed submission:
n = int(input())
s = list(map(str,input().split()))
if "Y" in s:
    print("Four")
else:
    print("Three")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
if "Y" in s:
    print("Four")
else:
    print("Three")
Problem p03457 (python)

Fixed submission:
n = int(input())
flag = True
for _ in range(n):
    t, x, y = map(int, input().split())
    if (t < x + y) or (x + y + t) % 2==1:
        flag = False


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

Buggy submission (verdict: Runtime Error):
n = int(input())
flag = True
for _ in range(N):
    t, x, y = map(int, input().split())
    if (t < x + y) or (x + y + t) % 2==1:
        flag = False


if flag:
    print("Yes")
else:
    print("No")
Problem p03485 (python)

Fixed submission:
import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2)))
Problem p03486 (python)

Fixed submission:
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t,reverse=True)
if s<t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t,reverse=True)

for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        exit()
    elif ord(s[i])>ord(t[i]):
        print("No")
        exit()
else:
    if len(t)-len(s)>0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t,reverse=True)

for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        exit()
    elif ord(s[i])>ord(t[i]):
        print("No")
        exit()
else:
    if len(t)-len(s)>0:
        print("Yes")
    else:
        print("No")
Problem p03605 (python)

Fixed submission:
n = input()
if "9" in n:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
dict = {}
for i in a:
    if i in dict:
        dict[i] += 1
    else:
        dict[i] = 1
ans = 0
for i in dict:
    if dict[i]%2==0:
        continue
    else:
        ans += 1
print(ans)
Problem p03607 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
dict = {}
for i in a:
    if i in dict:
        dict[i] += 1
    else:
        dict[i] = 1
ans = 0
for i in dict:
    if dict[i]%2==0:
        continue
    else:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [0 for i in range(10**5+1)]
for i in range(n):
    t = int(input())
    x[t]+=1
    if x[t]==2:
        x[t]=0
print(x.count(1))
Problem p03644 (python)

Fixed submission:
n = int(input())
if n>63:
    print(64)
elif n>31:
    print(32)
elif n>15:
    print(16)
elif n>7:
    print(8)
elif n>3:
    print(4)
elif n>1:
    print(2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n>63:
    print(64):
elif n>31:
    print(32)
elif n>15:
    print(16)
elif n>7:
    print(8)
elif n>3:
    print(4)
elif n>1:
    print(2)
else:
    print(1)
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
cnt = 0
tmp = 0
for i in range(n):
    if a[tmp]==2:
        print(cnt+1)
        exit()
    else:
        tmp =a[tmp]-1
        cnt += 1
else:
    print(-1)
    exit()

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
i = 0
cnt = 1
while a[i]!=2:
        if i == a[a[i]-1]-1:
        print(-1)
        exit()
    i=a[i]-1
    cnt += 1
else:
    print(cnt)
Problem p03846 (python)

Fixed submission:
n = int(input()) 
a = list(map(int,input().split())) 
a = sorted(a)
mod = 10**9+7
if n%2==0:
    k = 0
else:
    k = 1
if k==0:
    for i in range(1,n,2):
        if a[i]!=i or a[i-1]!=i:
            print(0)
            exit()
    else:
        print(2**(n//2)%mod)
else:
    if a[0]!=0:
        print(0)
        exit()
    else:
        for i in range(2,n,2):
            if a[i-1]!=i or a[i]!=i:
                print(0)
                exit()
        else:
            print(2**(n//2)%mod)

Buggy submission (verdict: Runtime Error):
n = int(input()) 
a = list(map(int,input().split())) 
a = sorted(a)
mod = 10**9+7
if n%2==0:
    k = 0
else:
    k = 1
if k==0:
    for i in range(1,n,2):
        if a[i]!=i or a[i+1]!=i:
            print(0)
    else:
        print(2**(n//2)%mod)
else:
    if a[0]!=0:
        print(0)
    else:
        for i in range(2,n,2):
            if a[i-1]!=i or a[i]!=i:
                print(0)
        else:
            print(2**(n//2)%mod)
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())

if A <= 5:
  print(0)
elif A <= 12:
  C = B / 2
  print(int(C))
else :
  print(B)

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

if A < 5:
  print(0)
elif A < 12:
  C = B / 2
  print(C)
else :
  print(B)
Problem p03085 (python)

Fixed submission:
b = input()

if b == "T":
  OUT = "A"
elif b == "A":
    OUT = "T"
elif b == "G":
    OUT = "C"
else:
    OUT = "G"

print(OUT)

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

if b == "T":
  OUT = "A"
elif  b == "A":
    OUT = "T"
elif b == "G":
    OUT = "C"
else:
    OUT == "G"

print(OUT)
Problem p03316 (python)

Fixed submission:
A = input()

S = 0
for i in A:
  S = S + int(i)
  
if (int(A) % S) == 0:
  print("Yes")
else:
  print("No")

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

S = 0
for i in A:
  S = S + A(i)
  
if (int(A) % S) == 0:
  print("Yes")
else:
  print("No")

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

S = 0
for i in A:
  S = S + A[i]
  
if int(A) % S == 0:
  print("Yes")
else:
  print("No")

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

S = 0
for i in A:
  S += A[i]
  
if int(A) % S == 0:
  print("Yes")
else:
  print("No")

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

S = 0
for i in range(0,10):
  S += A[i]
  
if int(A) % S == 0:
  print("Yes")
else:
  print("No")

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

S = 0
for i in range(0,10):
  S += A[i]
  
if A % S == 0:
  print("Yes")
else:
  print("No")
Problem p03325 (python)

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

SUM = 0
for i in range(N):
  while a[i] >= 2 and a[i] % 2 == 0:
    SUM += 1
    a[i] //= 2
    
print(SUM)

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

SUM = 0
for i in range(N):
  while a[i] >= 2 and a[i] % 2 == 0:
    SUM += 1
    a[i] //= 2
    
print(SUM)

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

SUM = 0
for i in range(N):
  while a[i] >= 2 and a % 2 == 0:
    SUM += 1
    a[i] //= 2
    
print(SUM)

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

SUM = 0
for i in range(N):
  while a[i] >= 2 and a % 2 == 0:
    SUM += 1
    a[i] //= 2
    
print(SUM)
Problem p03338 (python)

Fixed submission:
#標準入力
N = int(input())
S = input()

Max_count = 0
#処理
for i in range(1, N):
  temporary_count = len(set(S[i:]) & set(S[:i]))
  if temporary_count > Max_count:
    Max_count = temporary_count
    
print(Max_count)

Buggy submission (verdict: Runtime Error):
#標準入力
N = int(input())
S = input()

Max_count = 0
#処理
for i in range(0, N):
  temporary_count = set(S[i:]) and (S[:i])
  if temporary_count > Max_count:
    Max_count = temporary_count
    
print(Max_count)
Problem p03351 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

if abs(A - C) <= D: #直接会話する場合
  print("Yes")
elif (abs(A - B) <= D) and (abs(B - C) <= D): #間接的に会話する場合
  print("Yes")
else:
  print("No")

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

if abs(A - C) <= D: #直接会話する場合
  print("Yes")
elif (abs(A - B) <= D) AND (abs(B - C) <= D): #間接的に会話する場合
  print("Yes")
else:
  print("No")

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

if abs(A - C) <= D: #直接会話する場合
  print("Yes")
else:
  if (abs(A - B) <= D) AND (abs(B - C) <= D):
    print("Yes")
  else:
    print("No")
Problem p03352 (python)

Fixed submission:
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = i ** j
    
    if beki > X:
      break
      
    elif beki > max_beki:
      max_beki = beki
 
print(max_beki)

Buggy submission (verdict: Runtime Error):
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X/2):
  for j in range(2,X/2):
    beki = i ** j
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Buggy submission (verdict: Runtime Error):
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X/2):
  for j in range(2,X/2):
    beki = i %% j
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Buggy submission (verdict: Runtime Error):
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = i %% j
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Buggy submission (verdict: Runtime Error):
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = b %% p
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Buggy submission (verdict: Runtime Error):
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = b %% p
    
    if beki > max_beki:
      max_beki = beki
      
print(max_beki)
Problem p03386 (python)

Fixed submission:
A, B, K =map(int,input().split())

if B-A <= K:
  for i in range(A, B+1):
    print(i)
else:
  C = []
  for i in range(A, A+K):
    C.append(i)
  
  D = []  
  for i in range(B, B-K, -1) :
    D.append(i)
    
  E = set(C) | set(D)
  F = sorted(E)
  
  for i in range(len(F)):
      print(F[i])

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

if B-A <= K:
  for i in range(A, B):
    print(i)
else:
  C = []
  for i in range(A, A+K):
    C.append(i)
  
  D = []  
  for i in range(B, B-K+1, -1) :
    D.append(i)

E = set(C) | set(D)
F = sorted(E)
print(F)

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

if B-A <= K:
  for i in range(A, B):
    print(i)
else:
  C = []
  for i in range(A, A+K):
    C.append(i)
  
  D = []  
  for i in range(B, B-K, -1) :
    D.append(i)

E = set(C) | set(D)
F = sorted(E)
print(F)

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

if B-A < K:
  for i in range(A, B):
    print(i)
else:
  C = []
  for i in range(A, A+K):
    C.append(i)
  
  D = []  
  for i in range(B, B-K, -1) :
    D.append(i)

E = set(C) | set(D)
F = sorted(E)
print(F)
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

if A < B:
  E = A
else:
  E = B
  
if C < D:
  F = C
else:
  F = D
  
print(E+F)

Buggy submission (verdict: Runtime Error):
#標準入力
N = int(input())
D, X = list(map(int, input().split()))

A = []
for i in range(N):
    A.append(input())
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)
Problem p03400 (python)

Fixed submission:
N = int(input())
D, X = map(int, input().split())
A = []
for i in range(N):
    A.append(int(input()))
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)

Buggy submission (verdict: Runtime Error):
N = int(input())
D, X = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)

Buggy submission (verdict: Runtime Error):
N = int(input())
D, X = = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)

Buggy submission (verdict: Runtime Error):
#標準入力
N = int(input())
D, X = list(map(int, input().split()))
A = []
for i in range(N):
    A.append(input())
    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)

Buggy submission (verdict: Runtime Error):
#標準入力
N = int(input())
D, X = list(map(int, input().split()))

A = []
for i in range(N):
    a.append(input()) 

    
B=0
for i in range(N):
    B += 1 + (D-1)//A[i]

    
Total = X + B

print(Total)

Buggy submission (verdict: Runtime Error):
#標準入力
N = int(input())
D, X = list(map(int, input().split()))

A = []
for i in range(N):
    a.append(input()) 

    
B=[]
for i in range(N):
    B[i] = 1 + A[i]//(D-1)
    
Total = X + sum(B)

print(Total)
Problem p03407 (python)

Fixed submission:
A, B, C = list(map(int, input().split()))

if A + B >= C:
  print("Yes")
else:
  print("No")

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

M= int(input())
t = []
for i in range(M):
    t.append(input())

    
max_count = 0
for i in range(N):
    for j in range(M):
        B = s.count(s[i]) - t.count(s[i])
        C = s.count(t[i]) - t.count(t[i])
        
        if B > C:
            E = B
        else:
            E = C
               
        if E > max_count:
            max_count = E
    
print(max_count)
Problem p03408 (python)

Fixed submission:
N= int(input())
s = list()
for i in range(N):
    s.append(input())

M= int(input())
t = list()
for i in range(M):
    t.append(input())

    
max_count = 0
for i in range(N):
    for j in range(M):
        B = s.count(s[i]) - t.count(s[i])
        C = s.count(t[j]) - t.count(t[j])
        
        if B > C:
            E = B
        else:
            E = C
               
        if E > max_count:
            max_count = E
    
print(max_count)

Buggy submission (verdict: Runtime Error):
N= int(input())
s = list()
for i in range(N):
    s.append(input())

M= int(input())
t = list()
for i in range(M):
    t.append(input())

    
max_count = 0
for i in range(N):
    for j in range(M):
        B = s.count(s[i]) - t.count(s[i])
        C = s.count(t[i]) - t.count(t[i])
        
        if B > C:
            E = B
        else:
            E = C
               
        if E > max_count:
            max_count = E
    
print(max_count)

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

M= int(input())
t = []
for i in range(M):
    t.append(input())

    
max_count = 0
for i in range(N):
    for j in range(M):
        B = s.count(s[i]) - t.count(s[i])
        C = s.count(t[i]) - t.count(t[i])
        
        if B > C:
            E = B
        else:
            E = C
               
        if E > max_count:
            max_count = E
    
print(max_count)

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

M= int(input())
t = []
for i in range(M):
    s.append(input())

    
max_count = 0
for i in range(N):
    for j in range(M):
        B = s.count(s[i]) - t.count(s[i])
        C = s.count(t[i]) - t.count(t[i])
        
        if B > C:
            E = B
        else:
            E = C
               
        if E > max_count:
            max_count = E
    
print(max_count)
Problem p03415 (python)

Fixed submission:
nums1 = input()
nums2 = input()
nums3 = input()


print(nums1[0]+nums2[1]+nums3[2])

Buggy submission (verdict: Runtime Error):
nums1 = list(map(int, input().split()))
nums2 = list(map(int, input().split()))
nums3 = list(map(int, input().split()))


print(nums1[0], nums2[1], nums3[2])
Problem p03424 (python)

Fixed submission:
N = int(input())
S = list(input().split())

COUNT = S.count("Y")

if COUNT > 0:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]

COUNT = S.count("Y")

if COUNT > 0:
  print("Four")
else:
  print("Three")

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

COUNT = S.count("Y")

if COUNT > 0:
  print("Four")
else:
  print("Three")
Problem p03316 (python)

Fixed submission:
s = input()
print(['Yes', 'No'][int(s) % sum(map(int, s)) != 0])

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>

using namespace std;
char a[15];
int main(){
    scanf("%s", a);
    int lsum = 0, sum = 0;
    for(int i = 0; i < strlen(a); i++){
        lsum += a[i] - '0';
        sum   = sum * 10 + a[i] - '0';
    }
    if(sum % lsum == 0) printf("Yes\n");
    else printf("No\n");
}
Problem p03001 (python)

Fixed submission:
w, h, x, y = map(int, input().split())

cnt = 0
if x == w / 2 and y == h / 2:
	cnt = 1

print(w * h / 2, cnt)

Buggy submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())

x1 = w - x
y1 = h - y

s = w * h / 2
s1 = x * h / 1
s2 = x1 * h / 1
s3 = y * w / 1 
s4 = y1 * w / 1

if s == s1:
	ans = s1
elif s == s2:
	ans = s2
elif s == s3:
	ans = s3
elif s == s4:
	ans = s4

cnt = 0

if s1 == ans:
	cnt += 1
if s2 == ans:
	cnt += 1
if s3 == ans:
	cnt += 1
if s4 == ans:
	cnt += 1

print(ans, end=" ")
if (cnt > 1):
	print(1)
else:
	print(0)
Problem p02772 (python)

Fixed submission:
N = int(input())

A = list(map(int, input().split()))

n=0

for i in range(N):
    a=A[i]
    if a%2==0 and a%3!=0:
        if a%5!=0:
            n+=1

if n==0:
    print("APPROVED")
else:
    print("DENIED")

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

A = list(map(int, input().split()))

for i in N:
    a=A[i]
    if a%2==0 and (a%3!=0 or a%5!=0):
        print("DENIED")
        break

print("APPROVED")