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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
import numpy as np
na1 = np.array(a).cumsum()
na2 = np.array(a).cumsum()
cnt1 = 0
hoge1 = 0
cnt2 = 0
hoge2 = 0
delta1 = 0
delta2 = 0
for i in range(n):
  na1[i] += hoge1
  na2[i] += hoge2
  if(i % 2 == 0 and na1[i] <= 0):
    delta1 = abs(na1[i]) + 1
    cnt1 = cnt1 + delta1
    hoge1 += delta1
    na1[i] += delta1
  elif(i % 2 == 1 and na1[i] >= 0):
    delta1 = abs(na1[i]) + 1 
    cnt1 = cnt1 + delta1
    hoge1 -= delta1
    na1[i] -= delta1    
  if(i % 2 == 1 and na2[i] <= 0):
    delta2 = abs(na2[i]) + 1
    cnt2 = cnt2 + delta2
    hoge2 += delta2
    na2[i] += delta2  
  elif(i % 2 == 0 and na2[i] >= 0):
    delta2 = abs(na2[i]) + 1
    cnt2 = cnt2 + delta2
    hoge2 -= delta2
    na2[i] -= delta2
  else:
    na1[i]
print(min([abs(cnt1),abs(cnt2)]))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
import numpy as np
na = np.array(a).cumsum()
cnt = 0
if(na[0] > 0):
  for i in range(n):
    delta = abs(na[i]) + 1
    if(i % 2 == 0 and na[i] <= 0):
      cnt = cnt + delta
      for j in range(i, n):
        na[j] += delta 
    elif(i % 2 == 1 and na[i] >= 0):
      cnt = cnt + delta
      for j in range(i, n):
        na[j] -= delta
    else:
      na[i]
else:
  for i in range(n):
    delta = abs(na[i]) + 1
    if(i % 2 == 1 and na[i] <= 0):
      cnt = cnt + delta
      for j in range(i, n):
        na[j] += delta
    elif(i % 2 == 0 and na[i] >= 0):
      cnt = cnt + delta
      for j in range(i, n):
        na[j] -= delta
    else:
      na[i]
print(cnt)
Problem p03853 (python)

Fixed submission:
n, m = list(map(int, input().split()))
a = [list(input()) for _ in range(n)]
for i in range(n):
	print("".join(a[i]))
	print("".join(a[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = list(map(int, input().split()))
a = [list(input()) for _ in range(n)]
for i in range(n):
	print("".join(arr[i]))
	print("".join(arr[i]))

Buggy submission (verdict: Runtime Error):
import pandas as pd
n, m = list(map(int, input().split()))
a = [list(input()) for _ in range(n)]
df = pd.DataFrame(a)
df_v = pd.concat([df, df], axis=0)
arr = df_v.values.tolist()
for i in range(n*2):
	print("".join(arr[i]))
Problem p02789 (python)

Fixed submission:
n, l = map(int, input().split())
if n == l:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
if n = l:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split)
if n = l:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
if n == l:
  print("Yes")
 else:
  print("No")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split)
if n = l:
  print("Yes")
 else:
  print("No")
Problem p03385 (python)

Fixed submission:
S = sorted(input())
if S == sorted('abc'):
    print('Yes')
else:
    print('No')

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

if S = "abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
S.sorted()
if S = "abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
S.sort()
if S = "abc":
  print("Yes")
else:
  print("No")
Problem p03399 (python)

Fixed submission:
a, b, c, d = map(int, open(0))
print(min(a, b) + min(c, d))

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, open[0])
print(min(a, b) + min(c, d))

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
print(min(a, b) + min(c, d))
Problem p03448 (python)

Fixed submission:
a, b, c, x = map(int, [input() for z in range(4)])
 
ans = 0
 
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, x = map(int, [input() fot z in range(4)])
 
ans = 0
 
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, x = map(int, [input() fot i in range(4)])

ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b)%2 != 0:
  print("Odd")
else:
  print("Even")

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

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

Fixed submission:
S = input()
print(S[:3]+"8"+S[4:])

Buggy submission (verdict: Runtime Error):
S = list(input())
print(S[:3]+"8"+S[4:])

Buggy submission (verdict: Runtime Error):
S = input()
S[3]="8"
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
S[3]=str("8")
print(S)
Problem p03478 (python)

Fixed submission:
n, a, b = map(int, input().split())
 
total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in x:
    y += int(j)
  if a <= y <= b:
    total += i
print(total)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
 
total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in X:
    y += int(j)
    
  if a <= y <= b:
    total += i
print(total)

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

total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in X:
    y += j
    
  if a <= y <= b:
    total += i

print(total)
Problem p03494 (python)

Fixed submission:
n = input()
 
A = list(map(int, input().split()))
 
counts = 0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  counts += 1
print(counts)

Buggy submission (verdict: Runtime Error):
n = input()
 
A = list(map(int, input().split()))
 
counts = 0
while all(a%2==0 for a in A):
	A = [a/2 for a in A]
    counts += 1
print(counts)

Buggy submission (verdict: Runtime Error):
n = input()
 
A = list(map(int, input().split())
 
counts = 0
while all(a%2==0 for a in A):
	A = [a/2 for a in A]
    counts += 1
print(counts)

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

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

counts = 0
while all(a%2==0 for a in A):
	texts = [a/2 for a in A]
    counts += 1
print(counts)
Problem p03555 (python)

Fixed submission:
a = input()
b = input()
 
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
c1, c2, c3 = input().split()
c4, c5, c6 = input().split()

if c1 == c6 and c2 == c5 and c3 == c4:
  print("YES")
else:
  print("NO")
Problem p03597 (python)

Fixed submission:
n = int(input())
a = int(input())
 
print(n*n - a)

Buggy submission (verdict: Runtime Error):
n, a = map(int, input().split())
 
print(n**2 - a)

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

print(n^2 - a)
Problem p03697 (python)

Fixed submission:
a, b = map(int, input().split())
if a + b < 10:
  print(a + b)
else:
  print("error")

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

A = a + b
if A < 10:
  print(A):
else:
  print("error")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a + b < 10:
  print(a + b):
else:
  print("error")
Problem p03844 (python)

Fixed submission:
a, b, c = input().split()
 
a = int(a)
c = int(c)
 
if b == "+":
  print(a + c)
elif b == "-":
  print(a - c)

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()

a = int(a)
c = int(c)

if b == "+":
  print(a + c)
elif b == "-":
  print(a - b)
Problem p03852 (python)

Fixed submission:
a = input()
 
if a == "e" or a == "i" or a == "a" or a == "u" or a == "o":
  print("vowel")
else:
  print("consonant")

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

if a == "e" or a == "i" or a == "a" or a == "u" or a == "o":
  print("vowel")
else:
  print("consonant)
Problem p03860 (python)

Fixed submission:
a, b, c = input().split()
 
a = a[0]
b = b[0]
c = c[0]
 
print(a + b + c)

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

a = a[0]
b = b[0]
c = c[0]

print(a + b + c)
Problem p03943 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if a == b + c:
  print("Yes")
elif b == a + c:
  print("Yes")
elif c == b + a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
 
if a == b + c:
  print("Yes")
elif b == a + c:
  print("Yes")
elif c = b + a:
  print("Yes")
else:
  print("No")

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

if a == b + c:
  print("YES")
elif b == a + c:
  print("YES")
elif c = b + a:
  print("YES")
else:
  print("NO")
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
 
print(int((a+b)*h/2))

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

print((a+b)*h/2)
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
 
if N > K:
  print(K*X + (N-K)*Y)
else:
  print(N*X)

Buggy submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())
 
if N > K:
  print(K*X + (N-K)*Y)
else:
  print(K*X)

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

A = K*X + (N-K)*Y
print(A)
Problem p04029 (python)

Fixed submission:
n = int(input())
j = 0
for i in range(n+1):
  j = j + i
  
print(j)

Buggy submission (verdict: Runtime Error):
n = input()
j = 0
for i in range(n):
  j = j + i
  
print(j)

Buggy submission (verdict: Runtime Error):
n = input()
j = 0
for i in range(n):
  j += i
  
print(j)
Problem p02972 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ls = [0]*(n+1)
ans = []
for i in reversed(list(range(n))):
    if sum(ls[::i+1][1:]) % 2 != a[i]:
        ls[i+1] = 1
        ans.append(i+1)
print(sum(ls))
if ans: print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ls = []
for i in reversed(range(n)):
    count = 0
    for lsi in ls:
        if lsi >= i and not lsi % i:
            count += 1
    if count % 2 != a[i]:
        ls.append(i+1)
print(len(ls))
print(' '.join(map(str, ls)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ls = []
for i in reversed(range(n)):
    count = 0
    for lsi in ls:
        if lsi >= i and not lsi % i:
            count += 1
    if count % 2 != a[i]:
        ls.append(i+1)
print(len(ls))
print(' '.join(map(str, ls)))
Problem p03163 (python)

Fixed submission:
n, w = map(int, input().split())
import numpy as np
dp = np.zeros(w+1, np.int64)
for i in range(n):
    wi, vi = map(int, input().split())
    np.maximum(dp[:-wi]+vi, dp[wi:], out=dp[wi:])
print(max(dp))

Buggy submission (verdict: Runtime Error):
n, w = map(int, input().split())
import numpy as np
dp = np.zeros((n+1, w+1), np.int64)
for i in list(range(n+1))[1:]:
    wi, vi = map(int, input().split())
    dp[i] = [max(dp[i-1][j], dp[i-1][j-wi]+vi) if j >= wi else dp[i-1][j] for j in range(w+1)]
print(max(dp[-1]))
Problem p02612 (python)

Fixed submission:
int_num = int(input())
n_surplus = int_num % 1000

if n_surplus == 0:
    print(0)
else:
    print(1000 - n_surplus)

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

n_surplus = input_num % 1000

if n_surplus == 0:
  print(n_surplus)
  else:
    print(1000 - n_surplus)
Problem p02613 (python)

Fixed submission:
N = int(input())
C = [0]*4
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  elif M == "WA":
    C[1] += 1
  elif M == "TLE":
    C[2] += 1
  elif M == "RE":
    C[3] += 1
    
print("AC x " + str(C[0]))
print("WA x " + str(C[1]))
print("TLE x " + str(C[2]))
print("RE x " + str(C[3]))

Buggy submission (verdict: Runtime Error):
N = int(input())
C =　[0]*4
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  else M == "WA":
    C[1] += 1
  else M == "TLE":
    C[2] += 1
  else M == "RE":
    C[3] += 1
    
print("AC" + " × " + str(C[0]))
print("WA" + " × " + str(C[1]))
print("TLE" + " × " + str(C[2]))
print("RE" + " × " + str(C[3]))

Buggy submission (verdict: Runtime Error):
N = int(input())
C =　[0]*4
Moji = ["AC","WA","TLE","RE"]
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  else M == "WA":
    C[1] += 1
  else M == "TLE":
    C[2] += 1
  else M == "RE":
    C[3] += 1
    
print(Moji[i] + " × " C[i] for i in range(len(Moji)))
Problem p02583 (python)

Fixed submission:
import itertools as it


N = int(input()) - 1
s = list(map(int, input().split()))
count = 0

c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    maximum = max(listed)
    listed.remove(maximum)
    if (listed[0] + listed[1]) > maximum:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
mport itertools as it


N = int(input())
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    if (i[0] + i[1]) > i[2]:
        count += 1

print(count)
Problem p02646 (python)

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if (v==w) or (w>v) :
    print('NO')
    exit()

if abs(a-b) / (v-w) <= t:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if abs(a-b) / (v-w) <= t:
    print('YES')
else:
    print('NO')
Problem p03125 (python)

Fixed submission:
a, b = (int(x) for x in input().split())
if (b % a):
    print(b-a)
else:
    print(b+a)

Buggy submission (verdict: Runtime Error):
a,b = int(x) for x in input().split()
if (!b%a):
    print(a+b)
else:
    print(b-a)
Problem p03238 (python)

Fixed submission:
if input() == "1":
  print("Hello World")
else:
  print(int(input())+int(input()))

Buggy submission (verdict: Runtime Error):
if input() == 1:
  print("Hello World")
else:
  print(int(input())+int(input()))
Problem p03244 (python)

Fixed submission:
from collections import Counter
n = int(input())
V = list(map(int,input().split()))
V_odd = V[::2]
V_eve = V[1::2]
odd_max = Counter(V_odd).most_common(1)
even_max = Counter(V_eve).most_common(1)

result = n - odd_max[0][1] - even_max[0][1]
if odd_max[0][0] == even_max[0][0]:
    odd_least,even_least = 0,0
    if Counter(V_odd).most_common(1) != Counter(V_odd).most_common(2):
        odd_least = (Counter(V_odd).most_common(2))[1][1]
    if Counter(V_eve).most_common(1) != Counter(V_eve).most_common(2):
        even_least = (Counter(V_eve).most_common(2))[1][1]
    if Counter(V_odd).most_common(1) == Counter(V_odd).most_common(2) and Counter(V_eve).most_common(1) == Counter(V_eve).most_common(2):
        result = int(n/2)
    else:
        result = min(n - odd_least - even_max[0][1],n - even_least - odd_max[0][1])

print(result)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
V = list(map(int,input().split()))
V_odd = V[::2]
V_eve = V[1::2]
odd_max = Counter(V_odd).most_common(1)
even_max = Counter(V_eve).most_common(1)

result = n - odd_max[0][1] - even_max[0][1]
if odd_max[0][0] == even_max[0][0]:
    odd_least,even_least = 0,0
    if Counter(V_odd).most_common(1) != Counter(V_odd).most_common(2):
        odd_least = (Counter(V_odd).most_common(2))[0][1]
    if Counter(V_eve).most_common(1) != Counter(V_eve).most_common(2):
        even_least = (Counter(V_eve).most_common(2))[0][1]
    if Counter(V_odd).most_common(1) == Counter(V_odd).most_common(2) and Counter(V_eve).most_common(1) == Counter(V_eve).most_common(2):
        result = int(n/2)
    else:
        result = min(n - odd_least - even_max,n - even_least - odd_max)


print(result)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
V = list(map(int,input().split()))
V_odd = V[::2]
v_eve = V[1::2]
odd_max = Counter(V_odd).most_common(1)
even_max = Counter(v_eve).most_common(1)

result = n - odd_max[0][1] - even_max[0][1]
if odd_max[0][0] == even_max[0][0]:
    odd_least,even_least = 0,0
    if Counter(V_odd).most_common(1) != Counter(V_odd).most_common(2):
        odd_least = (Counter(V_odd).most_common(2))[0][1]
    if Counter(v_eve).most_common(1) != Counter(v_eve).most_common(2):
        even_least = (Counter(V_eve).most_common(2))[0][1]
    if Counter(V_odd).most_common(1) == Counter(V_odd).most_common(2) and Counter(v_eve).most_common(1) == Counter(v_eve).most_common(2):
        result = int(n/2)
    else:
        result = min(n - odd_least - even_max,n - even_least - odd_max)


print(result)
Problem p03262 (python)

Fixed submission:
import fractions
import functools

N,X = map(int,input().split())
x_list = list(map(int,input().split()))

x_list.append(X)
x_list.sort()

x_len = list()
for i in range(1,N+1):
    x_len.append(x_list[i]-x_list[i-1])

x_len.sort(reverse = True)

result = functools.reduce(fractions.gcd,x_len)

print(result)

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

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

def gcd_mul(lis):
    if len(lis) == 2:
        return gcd(lis[0],lis[1])
    elif len(lis) == 1:
        return lis[0]
    new = gcd(lis[0],lis[1])
    del lis[0]
    lis[0] = new
    return gcd_mul(lis)

x_list.append(X)
x_list.sort()

x_len = list()
for i in range(1,N+1):
    x_len.append(x_list[i]-x_list[i-1])

x_len.sort(reverse = True)
print(gcd_mul(x_len))
Problem p03274 (python)

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

result = []
for i in range(N-K+1):
    s,g = i,i+K-1
    result.append(abs(x[s]) + abs(x[s] - x[g]))
    result.append(abs(x[g]) + abs(x[g] - x[s]))
result.sort()
print(result[0])

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
x = list(map(int,input().split()))
if K==1 and (0 in x):
    print(0)
else:
    if 0 in x:
        pass
    else:
        K += 1
        counter = 0
        for i in x:
            if i > 0:
                break
            else:
                counter += 1
        x.insert(counter,0)

    result = []
    g,s = x.index(0),x.index(0)-K+1
    while (not s>x.index(0)):
        if s<0 or g>(len(x)-1):
            s += 1
            g += 1
            continue
        else:
            result.append(2*(-x[s]) + x[g])
            result.append(-x[s] + 2*(x[g]))
            s += 1
            g += 1
    print(result.sort()[0])
Problem p03281 (python)

Fixed submission:
n = int(input())
if not n%2:
    n -= 1

result = 0

for i in range(1,n+2,2):
    cnt = 0

    for ii in range(1,i+2,2):
        if i%ii == 0:
            cnt += 1

    if cnt >= 8:
        result += 1

print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
if !n%2:
    n += 1

result = 0

for i in range(1,n+2,2):
    cnt = 0

    for ii in range(1,i+2,2):
        if i%ii == 0:
            cnt += 1

    if cnt >= 8:
        result += 1

print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
if !n%2:
    n += 1

result = 0

for i in range(1,n+2,2):
    print(i)
    cnt = 0

    for ii in range(1,i+2,2):
        if i%ii == 0:
            cnt += 1

    if cnt >= 8:
        result += 1

print(result)
Problem p03282 (python)

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

count = 0
while count < K:
    if S[count] != "1":
        print(S[count])
        break
    count += 1
else:
    print("1")

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

for i in S[K+1]:
    if i != "1":
        print(i)
        break
else:
    print(i)
Problem p03288 (python)

Fixed submission:
n = int(input())
if n < 1200:
    print("ABC")
elif n < 2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
r = int(input())
if n < 1200:
    print("ABC")
elif n < 2800:
    print("AEC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
r = int(input())
if n < 1200:
    print("ABC")
elif n < 2800:
    print("AEC")
else:
    print("AGC")
Problem p03316 (python)

Fixed submission:
n = int(input())
s_n = 0
for i in str(n):
    s_n += int(i)
if n%s_n == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s_n = 0
for i in str(n):
    s_n += i
if n%s_n == 0:
    print("Yes")
else:
    print("No")
Problem p03763 (python)

Fixed submission:
N = int(input())
s_list = []
s_set = []

for i in range(N):
	s_list.append(list(x for x in input()))

for i in s_list:
	s_set.append(set(i))

result_char = {x for x in 'qwertyuiopasdfghjklzxcvbnm'}

for i in range(N-1):
	result_char = (s_set[i] & s_set[i+1] & result_char)

result_char = list(result_char)
result_char.sort()

result = ''
for i in result_char:
	count = min(x.count(i) for x in s_list)
	result += i*count
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
s_set = []

for i in range(N):
	s_list.append(list(input().split('')))

for i in s_list:
	s_set.append(set(i))

result_char = set()

for i in range(N-1):
	result_char = (s_set[i] & s_set[i+1] & result_char)

result_char = list(result_char).sort()
result = ''
for i in result_char:
	count = min(x[i] for x in s_list)
	result += i*count
print(result)
Problem p02607 (python)

Fixed submission:
n = int(input())
z = input().split()
odd = 0
for i in range(n):
    if i % 2 == 0:
        if int(z[i]) % 2 == 1:
            odd += 1
print(odd)

Buggy submission (verdict: Runtime Error):
n = int(input())
z = list(int(input().split()))
odd = 0
for i in range(n):
    if i % 2 == 1:
        if int(z[i]) % 2 == 1:
            odd += 1
print(odd)
Problem p02675 (python)

Fixed submission:
n = int(input())
if n % 10 == 3:
    print("bon")
elif n % 10 == 0 or n % 10 == 1 or n % 10 == 6 or n % 10 == 8:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
n = input()
a = n % 10
if a == 3:
    print("bon")
elif a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
else:
    print("hon")
Problem p03470 (python)

Fixed submission:
n = int(input())

print(
  len(
    set(
      [
        int(input()) for _ in range(n)
      ]
    )
  )
)

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

println(
  len(
    set(
      [
        int(input()) for _ in range(n)
      ]
    )
  )
)
Problem p03109 (python)

Fixed submission:
# -*- coding: utf-8 -*-
 
date = input().split('/')
 
if(int(date[0]) >= 2020):
  print('TBD')
elif(int(date[0]) == 2019 and int(date[1]) >=5):
  print('TBD')
else:
  print('Heisei')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

date = input().split('/')

if(int(date[0]) >= 2020):
  print('TBD')
  elif(int(date[0]) == 2019 && int(date[1]) >=5):
    print('TBD')
    else:
      print('Heisei')
Problem p02607 (python)

Fixed submission:
N = int(input())
li = []
for i in input().split():
    li.append(int(i))

a = 1
count = 0
for i in li:
    if a % 2 == 1 and i % 2 == 1:
        count += 1
    a += 1
print(count)

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

a = 1
count = 0
for i in li:
    if a % 2 == 1 and li % 2 == 1:
        count += 1
    a += 1
print(count)