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

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

if A+B >C+D:
    print('Left')
elif A+B ==C+D:
    print('Balanced')
elif A+B <=C+D:
    print('Right')

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

if A+B >C+D:
    print('Left')
elif A+B ==C+D:
    print('Balanced')
else A+B <=C+D:
    print('Right')
Problem p03478 (python)

Fixed submission:
N,A,B = map(int,input().split())
a = 0
for i in range(1,N+1):
    s = sum(map(int,str(i)))
    if A <= s <= B:
        a += i
print(a)

Buggy submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
a = 0
for i in range(1,N+1):
    s = sum(map(int,str(i)))
    if A <= s <= B:
        a += n
print(a)
Problem p03485 (python)

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

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

Fixed submission:
from collections import Counter
N = int(input())
s = list(map(int,input().split()))
c = Counter(s)
ans = 0
for i,j in c.items():
    ans += j if j<i else j-i
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
s = list(map(int,input().split()))
c = Counter(src)
ans = 0
for i,j in c.items():
    ans += j if j<i else j-i
print(ans)
Problem p03543 (python)

Fixed submission:
N = input()
a = list(N)
if N[0]==N[1]==N[2]==N[3] or N[0]==N[1]==N[2] or N[1]==N[2]==N[3]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(N)
if N[0]==N[1]==N[2]==N[3] or N[0]==N[1]==N[2] or N[1]==N[2]==N[3]:
    print('Yes')
else:
    print('No')
Problem p03564 (python)

Fixed submission:
N = int(input())
K = int(input())
 
i = 1
for j in range(N):
    i=min(i*2, i+K)
print(i)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
 
i = 1
for i in range(N):
    if i >= K:
	i += K
    else:
	i *= 2
print(i)
Problem p03599 (python)

Fixed submission:
from math import ceil
A,B,C,D,E,F = map(int,input().split())
am,bm,cm,dm=ceil(31/A),ceil(31/B),ceil(F*E/(100+E)/C)+1,ceil(F*E/(100+E)/D)+1
temp = []
for a in range(am):
    for b in range(bm):
        for c in range(cm):
            for d in range(dm):
                w = 100*a*A+100*b*B
                s = c*C+d*D
                if w + s > F:
                    break
                else:
                    if w / 100 * E >= s:
                        temp.append([w+s,s])
print(*sorted(temp, key=lambda x: (100*x[1] / x[0] if x[0] else 0))[-1])

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
smax =int(F*E/(100+E))
wmax =F-smax
temp = []
for a in range(wmax//(A*100)+1):
    for b in range(wmax // (B*100)+1):
        for c in range(smax // (C)+1):
            for d in range(smax // (D)+1):
                if a == 0 and b== 0:
                    pass
                elif (c*C+d*D)/(100*a*A+100*b*B+c*C+d*D)<=E/(100+E) and 100*a*A+100*b*B <=wmax and c*C+d*D <=smax:
                    temp.append([100*a*A+100*b*B+c*C+d*D,c*C+d*D,(c*C+d*D)/(100*a*A+100*b*B+c*C+d*D)])
a = sorted(temp,key= lambda x:x[2],reverse=True)
print(str(a[0][0])+' '+str(a[0][1]))

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
smax =int(F*E/(100+E))
wmax =F-smax
temp = []
for a in range(wmax//min(A*100,B*100)+1):
    for b in range(wmax // min(A*100, B*100)+1):
        for c in range(smax // min(C, D)+1):
            for d in range(smax // min(C, D)+1):
                if a == 0 and b== 0:
                    pass
                elif (c*C+d*D)/(100*a*A+100*b*B)<=E/(100+E) and 100*a*A+100*b*B <=wmax and c*C+d*D <=smax:
                    temp.append([100*a*A+100*b*B,c*C+d*D])
maxn =[]
for i in temp:
    maxn.append(i[1]/i[0])
print(' '.join(map(str,temp[maxn.index(max(maxn))])))
Problem p03797 (python)

Fixed submission:
s,c = map(int,input().split())
if s<c/2:
    print((c-2*s)//4+s)
else:
    print(min(s,c//2))

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

if s<c/2:
    c_s = (c-2*s)//4
    sc = s
    print(c_s+sc)
else:
    sc = (min(s,c//2)
    print(sc)
Problem p03815 (python)

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

if x<=6:
    print(1)
elif 7<=x<=11:
    print(2)
else:
    if x%11 ==1 or x%11 ==2 or x%11 ==3 or x%11 ==4 or x%11 ==5 or x%11 ==6:
        print((x//11)*2+1)
    elif x%11 ==7 or x%11 ==8 or x%11 ==9 or x%11 ==10:
        print((x // 11) * 2 + 2)
    else:
        print((x//11)*2)

Buggy submission (verdict: Runtime Error):
print((int(input())//11)*2+(x%11-1)//6+1)
Problem p03838 (python)

Fixed submission:
x,y = map(int,input().split())
ans = 0
if abs(y) > abs(x):
  if x < 0:ans += 1
  if y < 0:ans += 1
  ans += (abs(y)-abs(x))
else:
  if x > 0:ans += 1
  if y > 0:ans += 1
  ans += (abs(x)-abs(y))
print(ans)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
if abs(y) > abs(x):
  if x < 0:ans += 1
  if y < 0:ans += 1
  ans += (abs(y)-abs(x))
else:
  if x > 0:ans += 1
  if y > 0:ans += 1
  ans += (abs(x)-abs(y))
print(ans)
Problem p03337 (python)

Fixed submission:
N=input().split()
A=int(N[0])
B=int(N[1])
Ans=A+B
if(Ans<A-B):
  Ans=A-B
  
if(Ans<A*B):
  Ans=A*B
  
print(Ans)

Buggy submission (verdict: Runtime Error):
N=input().split()
A=N[0]
B=N[1]
Ans=A+B
if(Ans<A-B):
  Ans=A-B
  
if(Ans<A*B):
  Ans=A*B
  
print(Ans)
Problem p03338 (python)

Fixed submission:
N=int(input())
S=input()
count_M=0
for i in range(N):
	SR=S[(i+1):]
	SL=S[:(i+1)]
	count = 0
	for j in range(len(SL)):
		for k in range(len(SR)):
			if(SL[j] == SR[k]):
				count+=1
				SR=SR.replace(SR[k],' ')
	
	if(count_M < count):
		count_M=count

print(count_M)

Buggy submission (verdict: Runtime Error):
N=Int(input())
S=input()
for i in range(N):
  SR=S[(i+1):]
  SL=S[:(i+1)]
  count=0
  for j in SL:
    for k in SR:
  	  if(SL[j]===SR[k]):
    	count++
        break

  if(count_M<count):
  		count_M=count

print(count)
Problem p03844 (python)

Fixed submission:
s=input().split()
A=int(s[0])
op=s[1]
B=int(s[2])
if(op=="+"):
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
s=input().split()
A=s[0]
op=s[1]
B=s[2]
if(op=="+"):
  print(A+B)
else:
  print(A-B)
Problem p03471 (python)

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

k = 0
for i in range(min(n,y//10000),-1,-1):
  for j in range(n+1-i):
    if 10000*i + 5000*j + 1000*(n-i-j) == y:
      print(i, j, n-i-j)
      k += 1
      exit()
      
if k == 0:
  print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
lists=[]
lists_2=[]
for i in range(n+1):
  for j in range(n+1-i):
    lists.append([i, j, n-i-j])

for k in lists:
  if 10000*k[0] + 5000*k[1] + 1000*k[2] == y:
    lists_2.append(k)

if len(k) == 0:
  print('-1 -1 -1')
else:
  print(lists_2[0][0],lists_2[0][1],lists_2[0][2])
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != '1':
        print(s[i])
        exit()
    else:
        if i == len(s) - 1:
            print('1')
            exit()
        if i + 1 == k:
            print('1')
            exit()

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
if s[0] != '1':
    print(s[0])
else:
    print(s[1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
if int(s[0]) != 1:
    print(s[0])
else:
    print(s[1])
Problem p03361 (python)

Fixed submission:
H,W = map(int,input().split())
S = []
flag = "Yes"
for i in range(0,H):
    S.append(list(input()))

    
for i in range(0,H):
    for j in range(0,W):
        if S[i][j] == "#":
            if i != 0 and S[i-1][j] == "#" : continue
            elif i != H-1 and S[i+1][j] == "#": continue
            elif j != 0 and S[i][j-1] == "#": continue
            elif j != W-1 and S[i][j+1] == "#":continue
            else: flag = "No"
            
print(flag)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
S = []
flag = "Yes"
for i in range(0,H):
    S.append(list(input()))

    
for i in range(0,H):
    for j in range(0,W):
        if S[i][j] == "#":
            if i != 0 and S[i-1][j] == "#" : continue
            elif i != H-1 and S[i+1][j] == "#": continue
            elif j != 0 and S[i][j-1] == "#": continue
            elif j != W-1 and S[i][j+1] == "#":continue
            else flag = "No"
            
print(flag)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
S = []
flag = "Yes"
for i in range(0,H):
    S.append(list(input()))

    
for i in range(0,H):
    for j in range(0,W):
        if S[i][j] == "#":
            if i != 0 and S[i-1][j] == "#" : continue
            elif i != H-1 and S[i+1][j] == "#": continue
            elif j != 0 and S[i][j-1] == "#": continue
            elif j != W-1 and S[i][j+1] == "#":continue
            else flag = "No"
            
print(flag)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
S = []
flag = "Yes"
for i in range(0,H):
    S.append(list(input()))

for j in range(0,W)
    
for i in range(0,H):
    for j in range(0,W):
        if S[i][j] == "#":
            if i != 0 and S[i-1][j] == "#" : continue
            elif i != H-1 and S[i+1][j] == "#": continue
            elif j != 0 and S[i][j-1] == "#": continue
            elif j != W-1 and S[i][j+1] == "#":continue
            else flag = "No"
            
print(flag)
Problem p03415 (python)

Fixed submission:
a = input()
x = [a[i:i+1] for i in range(len(a))]
b = input()
y = [b[i:i+1] for i in range(len(b))]
c = input()
z = [c[i:i+1] for i in range(len(c))]
ans = x[0]+y[1]+z[2]
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
e,f,g = input().split()
h,i,j = input().split()
print(a,f,j)
Problem p03424 (python)

Fixed submission:
N = int(input())

hina = [S for S in input().split()]

if "Y" in hina:
    print("Four")
else:
    print("Three")

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

if "Y" in hina:
    print("Four")
else:
    print("Three")
Problem p03457 (python)

Fixed submission:
N = int(input())
plan = []

for j in range(0,N):
    t,x,y = map(int,input().split())
    plan.append(t)
    plan.append(x)
    plan.append(y)

if (plan[0] < plan[1] + plan[2]) or ((plan[0] % 2) != ((plan[1] + plan[2]) % 2)):
    print("No")
    exit()

for i in range(0,N-1):
    time_dis = plan[i*3 +3] - plan[i*3]
    x_dis = abs(plan[i*3+1] - plan[i*3+1 +3])
    y_dis = abs(plan[i*3+2] - plan[i*3+2 +3])
    
    if (time_dis < x_dis + y_dis) or ((time_dis % 2) != ((x_dis + y_dis) % 2)):
        print("No")
        exit()
        
print("Yes")

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

for j in range(0,N):
    t,x,y = map(int,input().split())
    plan.append(t,x,y)

if (plan[0] < plan[1] + plan[2]) or ((plan[0] % 2) != ((plan[1] + plan[2]) % 2)):
    print("No")
    exit()

for i in range(0,N-1):
    time_dis = plan[i*3 +3] - plan[i*3]
    x_dis = abs(plan[i*3+1] - plan[i*3+1 +3])
    y_dis = abs(plan[i*3+2] - plan[i*3+2 +3])
    
    if (time_dis < x_dis + y_dis) or ((time_dis % 2) != ((x_dis + y_dis) % 2)):
        print("No")
        exit()
        
print("Yes")
Problem p03463 (python)

Fixed submission:
N, A, B = map(int,input().split())
if (B-1-A) % 2 == 0:
    print("Borys")
else:
    print("Alice")

Buggy submission (verdict: Runtime Error):
import sys
K = int(input())
A = [int(x) for x in input().split()]
A.reverse()
jmax, jmin = 2,2

if A[0] != 2:
    print(-1)
    sys.exit()


"""max"""
for i in range(0,K-1):
    drop_num = []
    for j in range(0,A[i]):  #脱落者数の候補を入れていく
        if ( jmax + j ) % A[i+1] == 0:
            drop_num.append(j)

        if drop_num == []:  #A[i]について一通り調べたのち脱落者数の候補がなければ終わる
            print(-1)
            sys.exit()

    max_drop = max(drop_num)
    jmax = jmax + max_drop

jmax = jmax + A[K-1] -1


"""min"""
for i in range(0,K-1):
    drop_num = []
    for j in range(0,A[i]):  #脱落者数の候補を入れていく
        if ( jmin + j ) % A[i+1] == 0:
            drop_num.append(j)

        if drop_num == []:  #A[i]について一通り調べたのち脱落者数の候補がなければ終わる
            print(-1)
            sys.exit()

    min_drop = min(drop_num)
    jmin = jmin + min_drop


print(jmin, jmax)
Problem p03254 (python)

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

a = 0
i = 0

list.sort()

if list[0] > x:
    print(0)

elif x > sum(list):
    print(n-1)

else:
    while x > 0 and x >= list[i]:
        x -= list[i]
        i += 1
        a += 1
        if i == n:
            break

    print(a)

Buggy submission (verdict: Runtime Error):
# AtCorder-Candy Distribution Again

n,x = map(int, input().split())
list[] = list(map(int, input().split()))

a = 0
i = 0
list.sort()

if x < list[0]:
    print(0)

elif x >= list[0]:

    while x >= list[i] and x > 0:
        x -= list[i]
        a += 1
        if i < n-1 and x < list[i+1]:
            break
        if i == n-1:
            if x > list[i]:
                a = n-1
            else:
                a = n
            break
        i += 1

    print(a)

Buggy submission (verdict: Runtime Error):
# AtCorder-Candy Distribution Again

n,x = map(int, input().split())
list[n] = list(map(int, input().split()))

a = 0
i = 0
list.sort()

if x < list[0]:
    print(0)

elif x >= list[0]:

    while x >= list[i] and x > 0:
        x -= list[i]
        a += 1
        if i < n-1 and x < list[i+1]:
            break
        if i == n-1:
            if x > list[i]:
                a = n-1
            else:
                a = n
            break
        i += 1

    print(a)

Buggy submission (verdict: Runtime Error):
# AtCorder-Candy Distribution Again

n,x = map(int, input().split())
list = list(map(int, input().split()))

a = 0
i = 0
list.sort()

if x < list[0]:
    print(0)

elif x >= list[0]:

    while x > 0 and x >= list[i]:
        x -= list[i]
        a += 1
        if x < list[i+1]:
            break
        i += 1

    print(a)
Problem p04043 (python)

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

def judge():
    if a==5:
        if b==5:
            if c==7:
                return print("YES")
            else:
                return print("NO")
        elif b==7:
            if c==5:
                return print("YES")
            else:
                return print("NO")

    elif a==7:
        if b==5:
            if c==5:
                return print("YES")
            else:
                return print("NO")
        else:
            return print("NO")


    else:
        return print("NO")

judge()

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

l = []
i = 0

l = [input() for i in range(n)]
result = sorted(l)
s = ''.join(result)
# for i in range(n):
print(s)

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

    if a==5:
        if b==5:
            if c==7:
                return print("YES")
            else:
                return print("NO")
        elif b==7:
            if c==5:
                return print("YES")
            else:
                return print("NO")

    elif a==7:
        if b==5:
            if c==7:
                return print("YES")
            else:
                return print("NO")
        elif :
            return print("NO")


    else:
        return print("NO")

judge()
Problem p03373 (python)

Fixed submission:
l = map(int, raw_input().split())

if l[0] + l[1] > 2 * l[2]:
	if l[3] < l[4]:
		if (l[4] - l[3]) * l[1] < (l[4] - l[3]) * 2 * l[2]:
			print l[3] * 2 * l[2] + (l[4] - l[3]) * l[1]
		else:
			print l[4] * 2 * l[2]
	else:
		if (l[3] - l[4]) * l[0] < (l[3] - l[4]) * 2 * l[2]:
			print l[4] * 2 * l[2] + (l[3] - l[4])  * l[0]
		else:
			print l[3] * 2 * l[2]
else:
	print l[3] * l[0] + l[4] * l[1]

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())

if l[0] + l[1] < 2 * l[2]:
	if l[3] < l[4]:
		return l[3] * 2 * l[2] + (l[4] - l[3]) * l[1]
	else:
		return l[4] * 2 * l[2] + (l[3] - l[4])  * l[0]
else:
	return l[3] * l[0] + l[4] * l[1]
Problem p03423 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

X = input()
print X//3

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
m,a,r,c,h = 0
for i in range(N):
	S = raw_input()
	if S[:1] == "M":
		m += 1
	elif S[:1] == "A":
		a += 1
	elif S[:1] == "R":
		r += 1
	elif S[:1] == "C":
		c += 1
	elif S[:1] == "H":
		h += 1
print m*a*r+m*a*c+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input.split()
for i in range(N):
	if S[i] == 'Y':
		print('Four')
		N = -1
		break
if N = -1:print('Three')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

X = raw_input()
print X/3

Buggy submission (verdict: Runtime Error):
X = raw_input()
print X//3
Problem p03424 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input().split()
for i in range(N):
	if S[i] == 'Y':
		print('Four')
		N = -1
		break
if N > -1:
	print('Three')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input.split()
for i in range(N):
	if S[i] == 'Y':
		print('Four')
		N = -1
		break
if N == -1:
	print('Three')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input.split()
for i in range(N):
	if S[i] == 'Y':
		print('Four')
		N = -1
		break
if N == -1:print('Three')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input.split()
for i in range(N)
	if S[i] == 'Y':
		print('Four')
		N = -1
		break
if N = -1:print('Three')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input.split()
For i in range(N)
	if S[i] == "Y":
		print "Four"
		N = -1
		break
if N = -1:print "Three"
Problem p03425 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
m = 0
a = 0
r = 0
c = 0
h = 0
for i in range(N):
	S = raw_input()
	if S[:1] == "M":
		m += 1
	elif S[:1] == "A":
		a += 1
	elif S[:1] == "R":
		r += 1
	elif S[:1] == "C":
		c += 1
	elif S[:1] == "H":
		h += 1
print m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
m,a,r,c,h = 0
for i in range(N):
	S = raw_input()
	if S[:1] == "M":
		m += 1
	elif S[:1] == "A":
		a += 1
	elif S[:1] == "R":
		r += 1
	elif S[:1] == "C":
		c += 1
	elif S[:1] == "H":
		h += 1
print m*a*r+m*a*c+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
for i in range(N):
	S = raw_input()
	if S[:1] == "M":
		m += 1
	elif S[:1] == "A":
		a += 1
	elif S[:1] == "R":
		r += 1
	elif S[:1] == "C":
		c += 1
	elif S[:1] == "H":
		h += 1
print m*a*r+m*a*c+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h
Problem p03274 (python)

Fixed submission:
str = input()
n,k = [int(x) for x in str.split()]
str = input()
list = [int(x) for x in str.split()]
ans = 1000000000
for i in range(0,n - k + 1):
	a = list[i]
	b = list[i + k - 1]
	if (a < 0) & (b > 0): #优先级需要加括号
	    ans = min(ans,min(b - a * 2,b * 2 - a))
	else:
		ans = min(ans,max(abs(a),abs(b)))
print(ans)

Buggy submission (verdict: Runtime Error):
str = input()
n,k = [int(x) for x in str.split()]
str = input()
list = [int(x) for x in str.split()]
ans = 100000000
a:int
b:int
for i in range(0,n - k + 1):
	a = list[i]
	b = list[i + k - 1]
	if (a < 0) & (b > 0): #优先级需要加括号
	    ans = min(ans,min(b - a * 2,b * 2 - a))
	else:
		ans = min(ans,max(abs(a),abs(b)))
print(ans)
Problem p03302 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")
Problem p03254 (python)

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

if len(child_list) == 1:
    if x > min(child_list):
        please_child = 0
    elif x == min(child_list):
        please_child = 1
elif len(child_list) > 1:
    nokori = x - min(child_list)
    please_child = 0 
    while nokori >=0:
        please_child +=1
        mini = min(child_list)
        child_list.remove(mini)
        if child_list == []:
            break
        if len(child_list) == 1:
            if nokori == min(child_list):
                please_child += 1
            if nokori > min(child_list):
                break
            else:
            	break
        else:    
            nokori -= min(child_list)
print(please_child)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input())
child_list = list(map(int, input()))

nokori = x - min(child_list)
please_child = 0 
while nokori >=0:
    please_child +=1
    mini = min(child_list)
    child_list.remove(mini)
    if child_list == []:
        break
    if len(child_list) == 1:
        if nokori == min(child_list):
            please_child += 1
        if nokori > min(child_list):
            break
    else:    
        nokori -= min(child_list)
print(please_child)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input())
child_list = list(map(int, input()))

nokori = x - min(child_list)
please_child = 0 
while nokori >=0:
    please_child +=1
    mini = min(child_list)
    child_list.remove(mini)
    if child_list == []:
        break
    nokori -= min(child_list)
print(please_child)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input())
child_list = list(map(int, input()))

nokori = x - min(child_list)
please_child = 0 
while nokori >0:
    please_child +=1
    mini = min(child_list)
    child_list.remove(mini)
    if child_list == []:
        break
    nokori -= min(child_list)
print(please_child)

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

for x>0:
  if x - min(child_list) > 0:
    please_child +=1
    child_list = child_list.remove(min(child_list))
  if child_list == []:
    break
  if x - min(child_list) =< 0:
    break
print(please_child)

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

for x>0:
  if x - min(child_list) > 0:
    please_child +=1
    child_list = child_list.pop(min(child_list))
  if child_list == []:
    break
  if x - min(child_list) =< 0:
    break
print(please_child)

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

for x>0:
  if x - min(child_list) > 0:
    please_child +=1
    child_list = child_list.pop(min(child_list))
  else:
    break
print(please_child)
Problem p03264 (python)

Fixed submission:
K = int(input())
if K%2 == 0:
    odd_number = K // 2
elif K%2 == 1:    
    odd_number = K // 2 + 1
even_number = K // 2 

print(odd_number*even_number)

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

odd_number = K // 2　+ 1
even_number = K // 2

print(odd_number*even_number)

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

odd_number = K // 2　+ 1
even_number = K // 2

print(odd_number*even_number)

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

odd_number = K // 2　+ 1
even_number = K // 2

print(odd_number*even_number)
Problem p03288 (python)

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

Buggy submission (verdict: Runtime Error):
S = str(input())
flag = False
 
if S.startswith("A"):
  if ((S[2]) == "C") ^ (S["-2"]=="C"):
  	index = S.find("C")
    for i, s in enumerate(S):
      if (i == 0) or (i == index):
        continue
      if s.islower():
        continue
        if i == len(s):
          flag == True
 
if flag == True:
  print("AC")
else:
  print("WA")