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

Fixed submission:
from collections import  defaultdict
from collections import deque
import math
N = int(input())

AB = [list(map(int,input().split())) for _ in range(N-1)]


d = defaultdict(list)

for a,b in AB:
    d[a-1].append(b-1)
    d[b-1].append(a-1)


def get_distance(start):
    visited = set([start,])
    distance = [999999999999999999 for _ in range(N)]
    distance[start ] =0
    to_visit = deque([ (1,a) for a in d[start]])

    while to_visit:
        dist,now = to_visit.popleft()
        visited.add(now)
        distance[now]=dist
        for a in d[now]:
            if a not in visited:
                to_visit.append((dist+1,a))

    return distance



a =(get_distance(0))
b= (get_distance(N-1))

distance_ = a[N-1]

def get_close(a,i):
    l = list(sorted([(a[x],x) for x in d[i]]))
    return l[0][1]

tmp = N-1
for i in range((distance_+1)//2-1):
   tmp = get_close(a,tmp)

middle_a = get_close(a,tmp)
middle_b = tmp



x = get_distance(0)
max_ = math.ceil(x[N-1]/2)





d[middle_a].remove(middle_b)
d[middle_b].remove(middle_a)


a_new = (get_distance(0))
b_new = (get_distance(N-1))
"""
print(a)
print(b)
print(middle_a)
print(middle_b)
print(a_new,b_new)
"""
if sum( q<99999999999999999 for q in a_new ) >sum( q<99999999999999999 for q in b_new ):
    print("Fennec")
else:
    print("Snuke")

Buggy submission (verdict: Runtime Error):
from collections import  defaultdict
from collections import deque
import math
N = int(input())

AB = [list(map(int,input().split())) for _ in range(N-1)]


d = defaultdict(list)

for a,b in AB:
    d[a-1].append(b-1)
    d[b-1].append(a-1)


def get_distance(start):
    visited = set([start,])
    distance = [999999999999999999 for _ in range(N)]
    distance[start ] =0
    to_visit = deque([ (1,a) for a in d[start]])

    while to_visit:
        dist,now = to_visit.popleft()
        visited.add(now)
        distance[now]=dist
        for a in d[now]:
            if a not in visited:
                to_visit.append((dist+1,a))

    return distance



a =(get_distance(0))
b= (get_distance(N-1))


for i in range(N):
    if a[i]==b[i] or a[i]==b[i]+1:
        middle_a = i
        #middle_b
        for j in d[i]:
            if b[j]==b[i]-1:
                middle_b = j

"""
print(a)
print(b)
print(middle_a)
print(middle_b)
"""
x = get_distance(0)
max_ = math.ceil(x[N-1]/2)





d[middle_a].remove(middle_b)
d[middle_b].remove(middle_a)

a_new = (get_distance(0))
b_new = (get_distance(N-1))
if sum( q<99999999999999999 for q in a_new ) >sum( q<99999999999999999 for q in b_new ):
    print("Fennec")
else:
    print("Snuke")
#route to -1
#0
#N-1
Problem p03206 (python)

Fixed submission:
D=int(input())
if D==25:
  print("Christmas")
elif D==24:
  print("Christmas Eve")
elif D==23:
  print("Christmas Eve Eve")
elif D==22:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
D=input()
if D==25:
  print("Christmas")
  elif D==24:
    print("Christmas Eve")
    elif D==23:
      print("Christmas Eve Eve")
      elif D==22:
        print("Christmas Eve Eve Eve")
Problem p03139 (python)

Fixed submission:
# coding: utf-8

import sys
import math

args = input().split()

n = int(args[0])
a = int(args[1])
b = int(args[2])

reta = a
retb = (n - a) - b

if retb > 0:
  retb = 0
else:
  retb = abs(retb)

print('{reta} {retb}'.format(reta=min(a,b),retb=retb))

sys.exit(0)

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

import sys

lines = sys.stdin.readlines()

n,a,b,c = lines
n = int(n.strip('\n'))
a = str(a.strip('\n'))
b = str(b.strip('\n'))
c = str(c.strip('\n'))

num = 0
if not(n == a == b == c):
  for i in range(n):
    if not(a[i] == b[i] == c[i]):
      if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        num = num+1
      else:
        num = num+2

print(num)       

sys.exit(0)
Problem p03200 (python)

Fixed submission:
S = input()
ans = 0
count = 0
for i in range(len(S)-1, -1, -1):
    if S[i] == "B":
        ans += len(S)-i-1-count
        count += 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
answer-0
counter=0
for i in range(len(s)-1,-1,-1):
    if s[i]=="B":
        answer += len(s)-i-1-counter
        counter += 1
print(answer)

Buggy submission (verdict: Runtime Error):
s=input()
answer-0
counter=0
for i in range(len(s)-1,-1,-1):
  if s[i]=="B":
    answer += len(s)-i-1-counter
    counter += 1
print(answer)
Problem p03347 (python)

Fixed submission:
import sys
N = int(input()) 
A = [int(sys.stdin.readline()) for _ in range(N)]
b = 0
for i, a in enumerate(A):
    if i + b < a:
        print(-1)
        sys.exit()
    else:
        b = a - i
ans = 0
pre = -1
for a in A[::-1]:
    if pre - 1 != a:
        ans += a
    pre = a
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
l =[]
#deal with error
for i in range(N):
    l.append(int(input()))
    if i == 0 and l[i]!=0:
        print(-1)
        break
    if i>=1:
        if l[i]-l[i-1]>1 :
            print(-1)
            break

counter=0#answerになる。
counter_n=l[0]#listの中の重複を数える。
l = l[::-1]
for i in range(N-1):
    if l[i]<l[i+1]:
        counter+=counter_n
        counter_n=0#初期化
    elif l[i]==l[i+1]:
        if counter_n == 0:
            counter_n = 2*l[i]
        else:
            counter_n += l[i]
        counter_n += l[i]
    elif l[i] == l[i+1]+1:
        counter += 1
counter += counter_n
print(counter)
Problem p03297 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        a,b = b,a
    while b:
        a, b = b, a % b
    return a
T = int(input())
for _ in range(T):
    A,B,C,D = map(int,input().split())
    if A < B or D < B:
        print('No')
    else:
        g = gcd(B,D)
        k = B//g
        r = (A-C)%B
        if r == 0:
            sm = C
        else:
            sm = C+r-B
        if sm < 0:
            print('No')
        else:
            s = sm%g
            if s + (k-1)*g <= C:
                print('Yes')
            else:
                print('No')

Buggy submission (verdict: Runtime Error):
from math import gcd
T = int(input())
for _ in range(T):
    A,B,C,D = map(int,input().split())
    if A < B or D < B:
        print('No')
    else:
        g = gcd(B,D)
        k = B//g
        r = (A-C)%B
        if r == 0:
            sm = C
        else:
            sm = C+r-B
        if sm < 0:
            print('No')
        else:
            s = sm%g
            if s + (k-1)*g <= C:
                print('Yes')
            else:
                print('No')
Problem p03303 (python)

Fixed submission:
w = input()
s = int(input())
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)

Buggy submission (verdict: Runtime Error):
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)

Buggy submission (verdict: Runtime Error):
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
Problem p03319 (python)

Fixed submission:
N, K = map(int,input().split())
A = list(map(int,input().split()))
n = A.index(min(A))
n2 = N-1-n
a,b = divmod(n,K-1)
c,d = divmod(n2,K-1)
if b == d == 0:
    print(a+c)
elif b+d < K:
    print(a+c+1)
else:
    print(a+c+2)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
A = list(map(int,input().split()))
n = A.index(min(A))
n2 = N-1-n
a,b = divmod(n,K-1)
c,d = divmod(n2,K-1)
if b == d == 0:
    print(a+c)
elif b+d < K
    print(a+c+1)
else:
    print(a+c+2)
Problem p03391 (python)

Fixed submission:
N = int(input())
c = -1
s = 0
for i in range(N):
    ai,bi = map(int,input().split())
    s += ai
    if ai > bi:
        if c == -1:
            c = bi
        if bi < c:
            c = bi
if c == -1:
    print(0)
else:
    print(s-c)

Buggy submission (verdict: Runtime Error):
N = int(input())
c = False
s = 0
for i in range(N):
    ai,bi = map(int,input().split())
    s += ai
    if ai > bi:
        if not C:
            c = bi
        if bi < c:
            c = bi
if not c:
    print(0)
else:
    print(s-c)
Problem p03415 (python)

Fixed submission:
ans = []
for i in range(3):
    a = input()
    ans.append(a[i])
re = "".join(ans)
print(re)

Buggy submission (verdict: Runtime Error):
a = input().split()
ans = []
for i in range(3):
    ans.append(a[i][i])
re = "".join(ans)
print(re)

Buggy submission (verdict: Runtime Error):
a = input().strip().split()
ans = []
for i in range(3):
    ans.append(a[i][i])
re = "".join(ans)
print(re)

Buggy submission (verdict: Runtime Error):
a = input().strip().split()
ans = []
for i in range(3):
    ans.append(a[i][i])
re = "".join(ans)
print(re)
Problem p03219 (python)

Fixed submission:
x,y=map(int,input().split())
print(x+y//2)

Buggy submission (verdict: Runtime Error):
x,y=map(input().split())
print(x+y//2)
Problem p03101 (python)

Fixed submission:
p=[list(map(int,input().split())) for i in range(2)]

print((p[0][0]-p[1][0])*(p[0][1]-p[1][1]))

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

(p[0][0]-p[1][0])*(p[0][1]-p[1][1])

Buggy submission (verdict: Runtime Error):
p=[input().split() for i in range(2)]

(p[0][0]-p[1][0])*(p[0][1]-p[1][1])

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

return H*W-h*W-w*H+h*w

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

return H*W-h*W-w*H+h*w
Problem p03455 (python)

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

c=a*b

if c%2==0:
  print('Even')
else:
  print('Odd')

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

c=a*b

if c%2==0:
  return 'Even'
else:
  return 'Odd'
Problem p03457 (python)

Fixed submission:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
    break
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]>=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
        break
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        break
        
if ans==True:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
li=[]
#while True:
for u in range(2):
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
    break
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]<=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
        break
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        break
        
if ans==True:
    print('Yes')

Buggy submission (verdict: Runtime Error):
li=[]
n=int(input())
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break
if li[i][1]<0 or li[i][2]<0 for i in range(n):
    print('NO')
else:
    nl=li[:][1,2]
    for j in range(n-1):
        d=nl[j+1][:]-nl[j][:]
        if not d==[1,0] or [0,1] or [-1,0] or [0,-1]:
            print('NO')
            break
    print('YES')
Problem p03470 (python)

Fixed submission:
n=int(input())
li=[int(input()) for i in range(n)]
li_set=list(set(li))        #重複したものを一つにまとめる
print(len(li_set))

Buggy submission (verdict: Runtime Error):
n=int(input())
li=[int(input()) for i in range(n)]
li_set=list(set(li))        #重複したものを一つにまとめる
print(len(li_s))
Problem p03471 (python)

Fixed submission:
li=list(map(int,input().split()))
n=li[0]
y=li[1]

a,b,c=-1,-1,-1

for i in range(n+1):
    for j in range(n-i+1):
        if y==10000*i+5000*j+1000*(n-i-j):
            a=i
            b=j
            c=n-i-j
            break
print(a,b,c)

Buggy submission (verdict: Runtime Error):
li=list(map(int,input().split()))
n=li[0]
y=li[1]

for i in range(n):
    for j in range(n-i):
        for k in range(n-i-j):
            if y=10000*i+5000*j+1000*k:
                print(i,j,k)
                break
print(-1,-1,-1)
Problem p03493 (python)

Fixed submission:
x=int(input())

s1=x//100
s2=x//10%10
s3=x%10

print(s1+s2+s3)

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

s1=x//100
s2=x//10%10
s3=x%10

print(s1+s2+s3)

Buggy submission (verdict: Runtime Error):
s1,s2,s3=map(int,input().split())

print(s1+s2+s3)
Problem p03494 (python)

Fixed submission:
t=int(input())

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

count=0
while True:
    x=[True if i%2==0 else False for i in li]
    if all(x):
        for i in range(t):
            li[i]=li[i]/2
        count+=1
    else:
        break
print(count)

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

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

count=0
while true:
  if li[0:t]%2==0:
  	for i in range(t):
    	li[i]=li[i]/2
    count+=1
	continue
  break
print(count)

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

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

count=0
while true:
  if li[0:t]%2==0:
  	for i in range(t):
    	li[i]=li[i]/2
    count+=1
	else:
  		break
print(count)
Problem p03635 (python)

Fixed submission:
n,m = map(int, input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(input())
print((n-1)*(m-1))
Problem p03712 (python)

Fixed submission:
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    t = input()
    print("#"+t+"#")
print("#"*(w+2))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    t = input()
    print("#"+w+"#")
print("#"*(w+2))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    w = input()
    print("#"+w+"#")
print("#"*(w+2))
Problem p03759 (python)

Fixed submission:
a,b,c=map(int, input().split())
if b-a==c-b:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().count())
if b-a==c-b:
    print('YES')
else:
    print('NO')
Problem p03844 (python)

Fixed submission:
c =input()
print(eval(c))

Buggy submission (verdict: Runtime Error):
N = int(input())
l = list(map(int, input().split()))
l_2 = []
gusu_kisu = N % 2
end_F = 0
for i in range(N):
    if gusu_kisu == 1:
        An = l[i]
        if An % 2 == 1:
            end_F = 1
            break
        elif An == 0 and l_2.count(0) == 1:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
    else:
        An = l[i]
        if An % 2 == 0:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
#     print(An)
# print(end_F)
if end_F == 0:
    print((2 ** (N // 2)) % 1000000007)
else:
    print(0)
Problem p04012 (python)

Fixed submission:
w=input()
a='Yes'
s='qwertyuiopasdfghjklzxcvbnm'
for i in range(26):
	if w.count(s[i])%2!=0:
		a='No'
		break
print(a)

Buggy submission (verdict: Runtime Error):
w=input()
s=''
while True:
	s=w[0]
	if w.count(s)%2==1:
		print('No')
		break
	w=w.replace(s,'')
	if w:
		print('Yes')
		break

Buggy submission (verdict: Runtime Error):
w=input()
s=''
while True:
	s=w[0]
	if w.count(s)%2==1:
		print('No')
		break
	print(w)
	w=w.replace(s,'')
	print(w)
	if w:
		print('Yes')
		break

Buggy submission (verdict: Runtime Error):
w=str(input())
s=''
while True:
	s=w[0]
	if w.count(s)%2==1:
		print('No')
		break
	w.replane(s,'')
	if w:
		print('Yes')
		break
Problem p04031 (python)

Fixed submission:
N = int(input())
l = list(map(int, input().split()))
c = 0
b = 0
for i in range(N):
    c += l[i] ** 2
    b += -2 * l[i]
x = -b / (2 * N)
x = round(x)
Ans = N * x ** 2 + b * x + c

print(Ans)

Buggy submission (verdict: Runtime Error):
import sympy as sym
N = int(input())
l = list(map(int, input().split()))
expr = 0
x = sym.symbols("x")
for i in range(N):
    expr = expr + (l[i] - x)**2
eq = sym.Eq(sym.Derivative(expr).doit())
a = sym.solve(eq, x)
# print(a)
a = a[0]
a = round(a)
# print(a)
a = expr.subs(x, a)
print(a)
Problem p04045 (python)

Fixed submission:
c = 0
f = True
N, K = map(int, input().split())
ld = list(map(str, input().split()))
while f:
    i = 0
    N_str = str(N)
    for i in range(K):
        # print(i)
        if ld[i] in N_str:
            N += 1
            break
        elif i == K-1:
            f = False
print(N)

Buggy submission (verdict: Runtime Error):
l = list(range(10001))
l = list(map(str, l))
c = 0
N, K = map(int, input().split())
ld = list(map(str, input().split()))
del l[:N]
while True:
    if any(x in l[c] for x in ld):
        c += 1
    else:
        break
print(int(l[c]))

Buggy submission (verdict: Runtime Error):
l = list(range(10001))
l = list(map(str, l))
print(l)
c = 0
N, K = map(int, input().split())
ld = list(map(str, input().split()))
del l[:N]
while True:
    if any(x in l[c] for x in ld):
        c += 1
    else:
        break
print(int(l[c]))
Problem p03352 (python)

Fixed submission:
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)

Buggy submission (verdict: Runtime Error):
x=int(input())
c=1
for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
      else:break
print(c)
Problem p03609 (python)

Fixed submission:
x,t=map(int,input().split())
print(max(0,x-t))

Buggy submission (verdict: Runtime Error):
x,t=map(int,input().split)
print(max(0,x-t))

Buggy submission (verdict: Runtime Error):
x,t=map(int,input().split)
print(max(0,x-t))

Buggy submission (verdict: Runtime Error):
x,t=map(int,input().split)
print(max(0,x-t)
Problem p03145 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input())
print(a*b/2)
Problem p03280 (python)

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

print((a*b)-a-b+1)

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

print((a*b)-a-b+1)

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

print(a*b-a-b+1)
Problem p03485 (python)

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

print(-(-(a+b)//2))

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

print(-(-(a+b)//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(-(-((a+b)//2))
Problem p03605 (python)

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

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

if 9 in n:
  print('Yes')
else:
  print('No')

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

if n in 9:
  print('Yes')
else:
  print('No')
Problem p03635 (python)

Fixed submission:
n,m=map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=int(input().split())
print((n-1)*(m-1))
Problem p03796 (python)

Fixed submission:
import math
print(math.factorial(int(input())) % (10**9+7))

Buggy submission (verdict: Runtime Error):
import math
print(math.factorial(int(input()) % (10**9+7))

Buggy submission (verdict: Runtime Error):
import math
print(math.factorial(int(input())%10**9+7)
Problem p03280 (python)

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

print((a * b) - a - b + 1)

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

print((a * b) - a - b + 1)
Problem p03455 (python)

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


if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

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

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

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

Buggy submission (verdict: Runtime Error):
a = int(input())
if 9 in a:
  print("Yes")
else:
  print("No")
Problem p03280 (python)

Fixed submission:
a, b = map(int, input().split())
print((a - 1) * (b - 1))

Buggy submission (verdict: Runtime Error):
print((a - 1) * (b - 1))
Problem p03494 (python)

Fixed submission:
n = input()
a = list(map(int, input().split()))
ans = float('inf')
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
ans = float('inf')
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
print(round(ans))

# %% 	Coins
a, b, c, x = map(int, [input() for 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 p03126 (python)

Fixed submission:
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
    k=list(map(int,input().split()))
    for g in range(k[0]):
        a[k[g+1]-1]+=1
s=0
for i in range(m):
    if a[i]==n:
        s+=1
print(s)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
    k=list(map(int,input().split()))
    for g in range(k[0]):
        a[k[g]]+=1
s=0
for i in range(m):
    if a[i]==n:
        s+=1
print(s)
Problem p03145 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(str(int(0.5*a*b)))

Buggy submission (verdict: Runtime Error):
mizuyari=0
n=int(input())
s=list(map(int,input().split()))
def hiku(n):
    return n-1
for i in range(100):
    if s[0]>0:
        mizuyari+=1
    for j in range(n-1):
        if s[j]<=0 and s[j+1]>0:
            mizuyari+=1
    s=list(map(hiku,s))
else:
  print(mizuyari)
Problem p03101 (python)

Fixed submission:
listA = [] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;

H = listA[0][0]
W = listA[0][1]
h = listA[1][0]
w = listA[1][1]

ans = (H - h) * (W - w)

print(ans)

Buggy submission (verdict: Runtime Error):
listA = [] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;


field = []
# 縦幅
for(int i = 0; i < listA[0][0]; i++)
    field.appnd([])
    # 横幅
    for(int i = 0; i < listA[0][1]; i++)
        field[i].appnd(0)
        
for(int i = 0; i < listA[1][0]; i++)
    for(int j = 0; j < listA[1][1]; j++)
    field[i][j] = 1
    
cnt = 0
for item in field:
    for i in item:
        cnt++
        
print(cnt)
Problem p03597 (python)

Fixed submission:
n = int(input())
a = int(input())

print(n ** 2 - a)

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

print(int(n ** 2) - a)
Problem p03101 (python)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-H*w-h*W+h*w)

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w–map(int,input().split())
print(H*W-H*w-h*W+h*w)
Problem p03238 (python)

Fixed submission:
i=input;
print('Hello World') if '1'==i() else print(int(i())+int(i()))

Buggy submission (verdict: Runtime Error):
N=input()
if N=='1':print("Hello World")
else:
    l=list(map(int,N.split()))
    print(l[1]+l[2])

Buggy submission (verdict: Runtime Error):
N=input()
if N=='1':print("Hello World")
else:
    l=list(map(int,N.split()))
    print(l[1]+l[2])
Problem p03423 (python)

Fixed submission:
print(int(input())//3)

Buggy submission (verdict: Runtime Error):
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score=0
for x in range(5):
    for y in range(x+1,5):
        for z in range(y+1,5):
            score+=count_list[x]*count_list[y]*count_list[z]

print(score)

Buggy submission (verdict: Runtime Error):
n = input()
chars=input().split()
myset=set()
for char in chars:
    myset.add(char)

print(len(myset))