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

Fixed submission:
n = int(input())
v = [{}, {}]
for i, vi in enumerate(map(int, input().split())):
    j = i % 2
    v[j].update([(vi, v[j][vi] + 1)]) if vi in v[j] else v[j].update([(vi, 1)])
f1 = lambda v, i: max(v[i], key=v[i].get) if len(v[i]) > 0 else 0
f2 = lambda v, i, k: v[i].pop(k) if len(v[i]) > 0 else 0
kMax, vMax = [], []
for i in [0, 1]:
    kMax.append([f1(v, 0), f1(v, 1)])
    vMax.append([f2(v, 0, kMax[i][0]), f2(v, 1, kMax[i][1])])
if kMax[0][0] != kMax[0][1]:
    print(n - sum(vMax[0]))
else:
    print(n - max([vMax[0][0] + vMax[1][1], vMax[0][1] + vMax[1][0]]))

Buggy submission (verdict: Runtime Error):
n = int(input())
v = [{}, {}]
for i, vi in enumerate(map(int, input().split())):
    j = i % 2
    if vi in v[j]:
        v[j][vi] += 1
    elif not (vi in v[j]):
        v[j][vi] = 1
f1 = lambda v, i: max(v[i], key=v[i].get) if len(v[i]) > 0 else 0
f2 = lambda v, i, k: v[i].pop(k) if len(v[i]) > 0 else 0
kMax = [[f1(v, 0), f1(v, 1)]]
vMax = [[f2(v, 0, kMax[0][0]), f2(v, 1, kMax[0][1])]]
if kMax[0][0] != kMax[0][1]:
    print(n - sum(vMax[0]))
else:
    kMax.append([f1(v, 0), f1(v, 1)])
    vMax.append([f2(v, 0, kMax[0][0]), f2(v, 1, kMax[0][1])])
    print(n - max([vMax[0][0] + vMax[1][1], vMax[0][1] + vMax[1][0]]))
Problem p04044 (python)

Fixed submission:
import sys

def main(lines):
    print(''.join(sorted(lines.split())))

next(sys.stdin)
lines = ''
for line in sys.stdin:
    lines += line
main(lines)

Buggy submission (verdict: Runtime Error):
import sys

def main(lines):
    print(''.join(sorted(lines.split())))

next(sys.stdin)
for line in sys.stdin:
    lines += line
main(lines)
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)

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

if N == 1:
    print("Hello World")
else:
    A,B = map(int, input().split())
    print(A+B)
Problem p03239 (python)

Fixed submission:
import itertools
N, T = map(int, input().split())
CT = list(map(lambda _ :list(map(int, input().split())), range(N)))
if min(CT ,key = (lambda ct:ct[1]))[1] > T:
    print('TLE')
else:
    print(min(filter(lambda ct: ct[1]<=T, CT), key=(lambda ct: ct[0]))[0])

Buggy submission (verdict: Runtime Error):
import itertools
N, T = map(int, input().split())
CT = list(map(lambda _ :list(map(int, input().split())), range(N)))
print(min(filter(lambda ct: ct[1]<=T, CT), key=(lambda ct: ct[0]))[0])
Problem p03206 (python)

Fixed submission:
print('Christmas'+' Eve '*(25-int(input())))

Buggy submission (verdict: Runtime Error):
D=int(input())
if D==22:
  print(Christmas Eve Eve Eve)
elif D==23:
  print(Christmas Eve Eve)
elif D==24:
  print(Christmas Eve)
else:
  print(Christmas)
Problem p03211 (python)

Fixed submission:
X=input()
print(min(abs(int(X[i:i+3])-753) for i in range(len(X)-2)))

Buggy submission (verdict: Runtime Error):
X=input()
print(min(abs(int(S[i:i+3])-753) for i in range(len(S)-2)))
Problem p03212 (python)

Fixed submission:
X=int(input())
def momo(s):
  if int(s)>X:
    return 0
  nagi=1 if all(s.count(c)>0 for c in '753') else 0
  for c in '753':
    nagi+=momo(s+c)
  return nagi
print(momo('0'))

Buggy submission (verdict: Runtime Error):
X=int(input())
def momo(s)
if int(s)>X:
  return 0
 
nagi=1 if all(s.count(c)>0 for c in '753') else 0
  for c in '753':
    nagi+=momo(s+c)
    return nagi
print(momo('0'))

Buggy submission (verdict: Runtime Error):
X=int(input())
def momo(s)
if int(s)>N:
  return 0

nagi=1 if all(s.count(c)>0 for c in '753') else 0
  for c in '753':
    nagi+=momo(s+c)
    return nagi
print(momo('0'))
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
X,Y=int(input().split())
C=X+Y/2
print(C)
Problem p03219 (python)

Fixed submission:
#A-B間の運賃の入力 #B-C間の運賃の入力
X, Y= map(int, input().split())
#制約
if  X < 1 or Y%2 != 0 or Y > 100:
    SystemExit
#A-C合計運賃の計算と出力
print(int(X+Y/2))

Buggy submission (verdict: Runtime Error):
#A-B間の運賃の入力
X = int(input())
#B-C間の運賃の入力
Y = int(input())
#制約
if  X < 0 or Y%2 != 0 or Y > 100:
    SystemExit
#A-C合計運賃の計算と出力
print(X+Y/2)

Buggy submission (verdict: Runtime Error):
#A-B間の運賃の入力
X = int(input())
#B-C間の運賃の入力
Y = int(input())
#制約
if X < 1 or Y > 100 or Y%2 == 0:
#A-C合計運賃の計算と出力
print(X+Y/2)

Buggy submission (verdict: Runtime Error):
#A-B間の運賃の入力
a = int(input())
#B-C間の運賃の入力
b = int(input())
#A-C合計運賃の計算と出力
print(a+b/2)
Problem p03238 (python)

Fixed submission:
#年齢を取得
N = int(input())
#年齢による条件判断
if N == 1:
    print('Hello World')
elif N == 2:
    #AとBの値を取得
    A = int(input())
    B = int(input())
    #制約の判断
    if A < 1 or A > 9 or B < 1 or B > 9:
        SystemExit
    print(A+B)

Buggy submission (verdict: Runtime Error):
# 帰宅経路数と時間を取得
N, T = map(int, input().split())
# 時間制限
ans = 1001
# N個の帰宅経路と時間を取得し、比較する
for i in range(N):
    cost, time = map(int, input().split())
    if time < T:
        ans = min(ans, cost)
# 出力する
if ans == 1001:
    print("TLE")
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
# 帰宅経路数と時間を取得
N, T = map(int, input().split())
# 時間制限
ans = 1001
# 制約判断
if N < 1 or N > 100 or T < 1 or T > 1000:
    SystemExit
# N個の帰宅経路と時間を取得し、比較する
for i in range(N):
    cost, time = map(int, input().split())
    if time < T:
        ans = min(ans, cost)
# 出力する
if ans == 1001:
    print("TLE")
else:
    print(ans)
Problem p03239 (python)

Fixed submission:
n, l = map(int, input().split())
ans = 1001
for i in range(n):
    c, t = map(int, input().split())
    if t <= l:
        ans = min(ans, c)
if ans == 1001:
    ans = "TLE"
print(ans)

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    cost, tm = map(int, input().split())
    if tm <＝ T:
        ans = min(ans, cost)
if ans == 1001:
    ans = "TLE"
print(ans)

Buggy submission (verdict: Runtime Error):
# 帰宅経路数と時間を取得
N, T = map(int, input().split())
# 時間制限
ans = 1001
# N個の帰宅経路と時間を取得し、比較する
for i in range(N):
    cost, time = map(int, input().split())
    if time <＝ T:
        ans = min(ans, cost)
# 出力する
if ans == 1001:
    ans = "TLE"
print(ans)

Buggy submission (verdict: Runtime Error):
# 帰宅経路数と時間を取得
N, T = map(int, input().split())
# 時間制限
ans = 1001
# N個の帰宅経路と時間を取得し、比較する
for i in range(N):
    cost, time = map(int, input().split())
    if time <＝ T:
        ans = min(ans, cost)
# 出力する
if ans == 1001:
    print("TLE")
else:
    print(ans)
Problem p03210 (python)

Fixed submission:
# Title: Shichi-Go-San
# Link: https://abc114.contest.atcoder.jp/tasks/abc114_a

import sys


sys.setrecursionlimit(10 ** 6)

read_single_int = lambda: int(sys.stdin.readline().strip())


def solution(x: int):
    if x == 3 or x == 5 or x == 7:
        return 'YES'
    return 'NO'


def main():
    x = read_single_int()
    print(solution(x))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# Title: close to 753
# Link: https://abc114.contest.atcoder.jp/tasks/abc114_b

import sys


sys.setrecursionlimit(10 ** 6)

read_single_str = lambda: sys.stdin.readline().strip()


def solution(s):
    return min(map(lambda x: abs(x-753), map(int, [s[i:i+3] for i in range(len(s)-2)])))


def main():
    s = read_single_str()
    print(solution(s))


if __name__ == '__main__':
    main()
Problem p03206 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if n=25:
  print('Christmas')
elif n=24:
  print('Christmas Eve')
elif n=23:
  print('Christmas Eve Eve')
elif n=22:
  print('Christmas Eve Eve Eve')
Problem p03455 (python)

Fixed submission:
hoge=input()
hoge=hoge.split()
a=int(hoge[0])
b=int(hoge[1])
if a % 2 == 0 or b % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
hoge=input()
hoge=hoge.split()
a=int(hoge[0])
b=int(hoge[1])
if a % 2 == 0 or b % 2 == 0:
  print("Even")
else:
  print("Odd"

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a % 2 == 0 or b % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03493 (python)

Fixed submission:
hoge=input()
count=0
for i in range(3):
  if hoge[i] == '1':
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
hoge=input()
count=0
hoge=hoge.split()
for i in range(N):
  hoge[i] = int(hoge[i])
while True:
  all_even=True
  for i in range(N):
    if hoge[i] % 2 != 0:
      all_even = False
  if all_even == False:
    break
  else:
    count += 1
    for i in range(N):
      hoge[i]=hoge[i]/2
print(count)
Problem p03206 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=[]
for i in range(a):
	c.append(int(input()))
c=sorted(c)
#print(c)
f=[]
for k in range(a-b+1):
	e=[]
	f.append(e)
	for i in range(b):
		e.append(c[i+k])
#print(f)
g=[]
for i in range(len(f)):
	g.append(max(f[i])-min(f[i]))
print(min(g))
Problem p03238 (python)

Fixed submission:
"""
a=[]
for i in range():
	a.append(int(input()))

if a[0]!=1:
	print(a[1]+a[2])
else:
	print("Hello World")
"""
a=int(input())
if a==1:
	print("Hello World")
else:
	b=int(input())
	c=int(input())
	print(b+c)

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

if a[0]!=1:
	print(a[1]+a[2])
else:
	print("Hello World")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==1:
	print("Hello World")	
else:
    print(b+c)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a!=1:
	print(b+c)
else:
	print("Hello World")
Problem p03289 (python)

Fixed submission:
x = list(input())
#print(x[])

if x[0]=="A" :
	for i in range(2, len(x)-1, 1):
		if x[i]=="C":
			#print(x)
			del	x[i]
			del x[0]
			y="".join(x)
			#print(y)
			if y.islower():
				print("AC")
				break
			else:
				print("WA")
				break
	else:
		print("WA")

else:
	print("WA")

#print(x)

Buggy submission (verdict: Runtime Error):
x = list(input())
#print(len(x))

if x[0]=="A" :
	for i in range(2,len(x)-1):
		if x[i]=="C" :
#			print(x)
			del	x[i]
			del x[0]
			y="".join(x)
			#print(y)
			if y.islower():
				print("AC")
				break
			else:
					print("WA")
else:
	print("WA")

#print(x)
Problem p03292 (python)

Fixed submission:
x=list(map(int,input().split()))
y=sorted(x)
#print(y)
print(abs(y[0]-y[1])+abs(y[2]-y[1]))
#print(int(x[3]-x[2]))

Buggy submission (verdict: Runtime Error):
# x = input()
# print(x[-1]+x[:-1])
# y = x[-1]+x[:-1]
# print(y[-1]+y[:-1])

count=0

def check():
	count=0
	for i in range(len(a[0])):
		if(a[0][i]!=a[1][i]):
			break
		if(i==int(len(a[0])-1)):
			count=1
			print("Yes")
	return count


def change():
	b=[]
	for i in range(len(a[0])-1):
		b.append(a[1][i+1])
	b.append(a[1][0])

	a[1]=b


###変数を得る
a = []
for i in range(2):
    a.append(input())



check()

if(count==0):
	for i in range(len(a[0])-1):
		change()
		count=check()

		if(count==1):
			break

if(count==0):
	print("No")

Buggy submission (verdict: Runtime Error):
# x = input()
# print(x[-1]+x[:-1])
# y = x[-1]+x[:-1]
# print(y[-1]+y[:-1])

count=0

def check():
	count=0
	for i in range(len(a[0])):
		if(a[0][i]!=a[1][i]):
			break
		if(i==int(len(a[0])-1)):
			count=1
			print("Yes")
	return count


def change():
	b=[]
	for i in range(len(a[0])-1):
		b.append(a[1][i+1])
	b.append(a[1][0])

	a[1]=b


###変数を得る
a = []
for i in range(2):
    a.append(input())



check()

if(count==0):
	for i in range(len(a[0])-1):
		change()
		count=check()

		if(count==1):
			break

if(count==0):
	print("No")
Problem p03324 (python)

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

c=[]
for i in range(1,102):
	c.append(i*100**a)
if b!=100:
	print(c[b-1])
else:
	print(c[b])

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

c=[]
for i in range(1,101):
	c.append(i*100**a)
if b!=100:
	print(c[b-1])
else:
	print(c[b])

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

c=[]
for i in range(1,b+1):
	c.append(i*100**a)
if b!=100:
	print(c[b-1])
else:
	print(c[b])

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

c=[]
for i in range(1,100):
	c.append(i*100**a)
print(c[b-1])
Problem p03386 (python)

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

if b-a+1>2*c:
	x=[i for i in range(a,a+c)]
	y=[i for i in range(b-c+1,b+1)]
	e=x+y
else:
	e=[i for i in range(a,b+1)]
#print(e)
for i in e:
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=[]
for i in range(a,b+1):
	d.append(i)
#print(d)
e=[]
if c<b:
	for i in range(c):
		e.append(d[i])
		e.append(d[-i-1])
else:
	for i in d:
		print(i)


e=set(e)
e=list(e)
e.sort()
for i in e:
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=[]
for i in range(a,b+1):
	d.append(i)
#print(d)
e=[]
if c<b:
	for i in range(c):
		e.append(d[i])
		e.append(d[-i-1])
else:
	for i in d:
		print(i)
e.sort()
e=set(e)
for i in e:
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=[]
for i in range(a,b+1):
	d.append(i)
#print(d)
e=[]
if c<b:
	for i in range(c):
		e.append(d[i])
		e.append(d[-i-1])
else:
	for i in d:
		print(i)
#print(e)
for i in sorted(set(e)):
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=[]
for i in range(a,b+1):
	d.append(i)
#print(d)
e=[]
if c<b:
	for i in range(c):
		e.append(d[i])
		e.append(d[-i-1])
else:
	for i in d:
		print(i)
for i in sorted(set(e)):
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=[]
for i in range(a,b+1):
	d.append(i)
#print(d)
e=[]
if c<=b:
	for i in range(c):
		e.append(d[i])
		e.append(d[-i-1])
else:
	for i in d:
		print(i)
for i in sorted(set(e)):
	print(i)
Problem p03502 (python)

Fixed submission:
a=[int(i) for i in input()]
b=""
for i in range(len(a)):
	b=b+str(a[i])
	int(b)
c=int(sum(a))
b=int(b)
#print(c)
#print(b)
if b%c==0:
	print("Yes")
else:
	print('No')

Buggy submission (verdict: Runtime Error):
a=[int(i) for i in input()]
for i in range(len(a)-1):
	b=str(a[i])+str(a[i+1])
	int(b)
c=int(sum(a))
b=int(b)
if b%c==0:
	print("Yes")
else:
	print('No')
Problem p03206 (python)

Fixed submission:
IN = int(input())

if IN == 25:
    print("Christmas")
elif IN == 24:
    print("Christmas Eve")
elif IN == 23:
    print("Christmas Eve Eve")
elif IN == 22:
    print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))
Problem p03371 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 21 21:25:13 2018

@author: Kim
"""

IN = input().split()
A = int(IN[0])
B = int(IN[1])
C = int(IN[2])
X = int(IN[3])
Y = int(IN[4])

#そのまま買う
As = A * X
Bs = B * Y
ALLSUM = As + Bs

#ハーフをどちらかに合わせる
Cmax = 2 * max(X,Y) * C
Cmin = 2 * min(X,Y) * C

#ハーフの場合で小さい方に合わせた時の差分とその額
sabunkosuu = max(X,Y) - min(X,Y)
if X > Y:
    sabungaku = A * sabunkosuu
elif X < Y:
    sabungaku = B * sabunkosuu
else:
    sabungaku = 0

#そしてそれを足した時の額
halfmin = Cmin + sabungaku 

#全部比べる
ANS = min(ALLSUM, Cmax, halfmin)
print(ANS)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 21 21:25:13 2018

@author: Kim
"""

IN = input().split()
A = int(IN[0])
B = int(IN[1])
C = int(IN[2])
X = int(IN[3])
Y = int(IN[4])

#そのまま買う
As = A * X
Bs = B * Y
ALLSUM = As + Bs

#ハーフをどちらかに合わせる
Cmax = 2 * max(X,Y) * C
Cmin = 2 * min(X,Y) * C

#ハーフの場合で小さい方に合わせた時の差分とその額
sabunkosuu = max(X,Y) - min(X,Y)
if X > Y:
    sabungaku = A * sabunkosuu
elif X < Y:
    sabungaku = B * sabunkosuu

#そしてそれを足した時の額
halfmin = Cmin + sabungaku 

#全部比べる
ANS = min(ALLSUM, Cmax, halfmin)
print(ANS)
Problem p03379 (python)

Fixed submission:
from statistics import median, median_low, median_high


N = int(input())

X = input().split()
X = [ int(x) for x in X]
"""
N = 4
X = [2,4,4,3]
"""
median = median(X)
#F = copy.deepcopy(X)
"""
F = X[:]
F.sort()

median1 = int(N/2 - 1)
median2 = int(N/2) 

if median.is_integer():
    median1 = median
    median2 = median
else:
    median1 = median - 0.5
    median2 = median + 0.5
"""
median1 = median_low(X)
median2 = median_high(X)
   
for i in range(N):
    #print(F, median1, median2)
    
    if X[i] < median:
        ans = median2
    else:
        ans = median1
    print(int(ans))

Buggy submission (verdict: Runtime Error):

N = int(input())

X = input().split()
X = [ int(x) for x in X]
"""
N = 4
X = [2,4,4,3]
"""

#F = copy.deepcopy(X)
F = X[:]
F.sort()

median1 = int(N/2 - 1)
median2 = int(N/2) 

for i in range(N):
    #print(F, median1, median2)
    
    if X[i] < median(F):
        ans = F[median2]
    else:
        ans = F[median1]
    print(int(ans))
Problem p03408 (python)

Fixed submission:
N = int(input())
INPn = [input() for i in range(N)]
M = int(input())
INPm = [input() for i in range(M)]

ans = [0] * N

for i in range(N):
    for k in range(N):
        if INPn[i] == INPn[k]:
            ans[i] += 1
for i in range(N):
    for j in range(M):

        if INPn[i] == INPm[j]:
            ans[i] -= 1

for i in range(N):
    if ans[i] < 0:
        ans[i] = 0
        
mx = max(ans)
print(mx)

Buggy submission (verdict: Runtime Error):
INP = input().split()
N = int(INP[0])
M = int(INP[N + 1])
ans = [0] * N

for i in range(N):
    for k in range(N):
        if INP[i + 1] == INP[k + 1]:
            ans[i] += 1
for i in range(N):
    for j in range(M):

        if INP[i+1] == INP[N + j + 1]:
            ans[i] -= 1

for i in range(N):
    if ans[i] < 0:
        ans[i] = 0
        
mx = max(ans)
print(mx)

Buggy submission (verdict: Runtime Error):

INP = input().split()
N = int(INP[0])
M = int(INP[N + 1])
ans = [0] * N

for i in range(N):
    for k in range(N):
        if INP[i + 1] == INP[k + 1]:
            ans[i] += 1
for i in range(N):
    for j in range(M):

        if INP[i+1] == INP[N + j + 1]:
            ans[i] -= 1
mx = max(ans)
print(mx)

Buggy submission (verdict: Runtime Error):
INP = input().split()
N = int(INP[0])
M = int(INP[N + 1])
#print(N,M)
ans = [0] * N
#print(ans)

for i in range(N):
    for k in range(N):
        if INP[i + 1] == INP[k + 1]:
            print(INP[i + 1])
            ans[i] += 1
for i in range(N):
    for j in range(M):

        if INP[i+1] == INP[N + j + 1]:
            ans[i] -= 1
mx = max(ans)
print(mx)
Problem p03308 (python)

Fixed submission:
N = int(input())

a = list(map(int, input().split()))
print(abs(max(a) - min(a)))

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

a = list(map(int,input().split())
print(abs(max(a)-min(a))
Problem p03433 (python)

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

if N % 500 <= A:
    print("Yes")
else:
    print("No")

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

if N % 500 < A:
    return "YES"
else:
    return "NO"
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print((a + b + 1) // 2)

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

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

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

return int((a+b)/2)

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

print(int((a+b)/2))
Problem p03238 (python)

Fixed submission:
n = int(input())

if n == 1:
  print("Hello World")
  
else:
  a = int(input())
  b = int(input())
  print(a + b)

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

if n == 1:
  	print("Hello World")
  
else:
  	a = int(input())
  	b = int(input())
  print(a + b)

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

if N == 1:
  	print("Heloo World")
  
else:
  	A = int(input())
  	B = int(input())
  print(A + B)
Problem p03239 (python)

Fixed submission:
Input = input()
li = Input.split(" ")
NT = list(map(int,li))
N = NT[0]
T = NT[1]
i = 1
mi = 9999

while i <= N:
    Input = input()
    li = Input.split(" ")
    a = list(map(int,li))
    c = a[0]
    t = a[1]
    if t <= T and c < mi:
        mi = c
    i += 1

if mi == 9999:
    print("TLE")
else:
    print(mi)

Buggy submission (verdict: Runtime Error):
li = str(input).split(" ")
NT = list(map(int,li))
N = NT[0]
T = NT[1]
i = 1
mi = 9999
while i <= 3:
    a = list(map(int,input.split()))
    c = a[0]
    t = a[1]
    if t <= T and c < mi:
        mi = c
    i += 1

if mi == 9999:
    print("TLE")
else:
    print()
Problem p03274 (python)

Fixed submission:
nk = list(map(int, input().split()))
n = nk[0]
k = nk[1]
x = list(map(int, input().split()))
min_d = 10 ** 9
for i in range(n - k + 1):
    max_i = x[i + k - 1]
    min_i = x[i]
    if max_i <= 0:
        min_d_i = - min_i
    elif min_i >= 0:
        min_d_i = max_i
    else:
        min_d_i = min(- min_i + 2 * max_i, -2 * min_i + max_i)
    if min_d_i < min_d:
            min_d = min_d_i
print(min_d)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
x = list(map(int,input().split()))
time = 10**9

for i in range(n - k + 1):
    x_k = [ x[i], x_k[i+k-1] ]
    #print(x_k)
    
    if x_k[0] >= 0:
        t = x_k[1]
            
    elif x_k[1] <= 0:
        t = -x_k[0]
    
    else:
        t = min(-x_k[0] + x_k[1] *2,-x_k[0] * 2 + x_k[1])

    time = min(t, time)
    
print(time)
Problem p03471 (python)

Fixed submission:
n,y = map(int,input().split())

price = 0
ok = 0

for i in range(n+1):
    for j in range(n+1):
            k = n - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == y and i+j+k == n and ok == 0:
                print(i, j, k)
                ok = 1
                break

    else:
        continue
    break

if ok == 0:
    print(-1, -1, -1 )

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

price = 0
ok = 0

for i in range(n+1):
    for j in range(n+1):
            k = n - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == y and i+j+k == n and ok == 0:
                print(i, j, k)
                ok = 1
                break

            else:
                no_flg = 1
    else:
        continue
    break

if no_flg == 1 and ok == 0:
    print(-1, -1, -1 )

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

price = 0
ok = 0

for i in range(n_y[0]+1):
    for j in range(n_y[0]+1):
            k = n_y[0] - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == n_y[1] and i+j+k == n_y[0] and ok == 0:
                print(i, j, k)
                ok = 1
                break

            else:
                no_flg = 1
    else:
        continue
    break

if no_flg == 1 and ok == 0:
    print(-1, -1, -1 )
Problem p03493 (python)

Fixed submission:
input_s = input().count("1")

print(input_s)

Buggy submission (verdict: Runtime Error):
def div_cnt(input_n):
    cnt = 0
    while input_n % 2 == 0:
        input_n /= 2
        cnt += 1

    return cnt

input_n = int(input())
input_a = list(map(int,input().split()))
cnt = min(map(div_cnt,input_a))

print(cnt)
Problem p03494 (python)

Fixed submission:
input_n = input()
input_a = input().split()
cnt = 0
end_flg = True

while end_flg:
    for i in range(int(input_n)):

        if int(input_a[i]) % 2 == 0:
            input_a[i] = int(input_a[i])/2

        else:
            end_flg = False
            break
    if end_flg == False:break
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
input_n = int(input())
input_a = map(int,input().split())
cnt = 0
end_flg = True

while end_flg:
    for i in range(input_n):

        if input_a[i] % 2 == 0:
            input_a[i] = input_a[i]/2

        else:
            end_flg = False
            break
    if end_flg == False:break
    cnt+=1

print(cnt)