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

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sums = sum(A)
sml = [abs(N*A[i]-sums) for i in range(N)]

tmp = 100
result = 0
for i, n in enumerate(sml):
    if tmp > n:
        result = i
        tmp = n

print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
sums = sum(A)/N
avg = round(sums)
avg2 = avg-1 if avg == math.ceil(sums) else avg+1

result = 0
for i in range(N):
    if A[i] == avg:
        result = i
        break
    if A[i] == avg2:
        result = i
print(result)
Problem p03495 (python)

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

buckets = {}
for i in A:
    if i in buckets:
        buckets[i] += 1
    else:
        buckets[i] = 1

kinds = sorted(buckets.values())
count = len(kinds)
if K < count:
    mini = 0
    for i in kinds:
        mini += i
        count -= 1
        if count <= K:
            break
    print(mini)
else:
    print(0)

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

buckets = {}
for i in A:
    if i in buckets:
        buckets[i] += 1
    else:
        buckets[i] = 1

kinds = sorted(buckets.values())
if K < len(kinds):
    mini = 0
    for i in range(len(kinds)):
        mini += kinds.pop(i)
        if len(kinds) <= K:
            break
    print(mini)
else:
    print(0)
Problem p03636 (python)

Fixed submission:
S = input()
size = len(S)
print(S[:1] + str(len(S[2:size])) + S[size-1:])

Buggy submission (verdict: Runtime Error):
input=sys.stdin.readline
S = input()
size = len(S)
print(S[:1] + str(len(S[2:size])) + S[size-1:])
Problem p03047 (python)

Fixed submission:
#!/usr/bin/env pypy3

import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce
from statistics import mean, median, median_low, median_high, mode
# Before Python 3.5
from fractions import gcd

#import numpy
#import scipy, scipy.special
#from sympy import isprime, nextprime
#from sympy.ntheory import factorint

inf = float('inf')

def lcm(a, b):
    return a * b // gcd(a,b)

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################


N, K = input_ints()

print(N-K+1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env pypy3

import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce
from statistics import mean, median, median_low, median_high, mode
# Before Python 3.5
from fractions import gcd

#import numpy
#import scipy, scipy.special
#from sympy import isprime, nextprime
#from sympy.ntheory import factorint

inf = float('inf')

def lcm(a, b):
    return a * b // gcd(a,b)

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################


N, K = input_ints()

print(N-K+1)
Problem p03126 (python)

Fixed submission:
N, M = [int(x) for x in input().split()]

likes = [0 for x in range(M)]

for n in range(N):
    s = [int(x) for x in input().split()]
    K = s[0]
    for k in range(K):
        likes[s[1+k] - 1] += 1

print(likes.count(N))

Buggy submission (verdict: Runtime Error):
N, M = [int(x) for x in input().split()]                                                                             │
                                                                                                                     │
likes = [0 for x in range(M)]                                                                                        │
                                                                                                                     │
for n in range(N):                                                                                                   │
    s = [int(x) for x in input().split()]                                                                            │
    K = s[0]                                                                                                         │
    for k in range(K):                                                                                               │
        likes[s[1+k] - 1] += 1                                                                                       │
                                                                                                                     │
print(likes.count(N))
Problem p02811 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a = list(map(int, input().split()))
print('Yes') if (500 * a[0] >= a[1]) else print('No')

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

N, M = map(int, input().split())
a_list = list(set(map(int, input().split())))

a = [int(i/2) for i in a_list]
ans = a[0]
for i in range(1, len(a)):
    ans = ans * a[i] // fractions.gcd(ans, a[i])

if ans <= M:
    b = M // ans

    if b % 2 == 1:
        print(b // 2 + 1)
    else:
        print(b // 2)
else:
    print(0)
Problem p03485 (python)

Fixed submission:
# -*- coding: utf-8 -*-

import math

a, b = map(int, input().split())

print(math.ceil((a+b)/2))

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

s = input()
t = input()

s_list = list(s)
t_list = list(t)

import itertools

flag = False

for i in itertools.permutations(s_list):
    s_new = ''.join(i)
    for n in itertools.permutations(t_list):
        t_new = ''.join(n)

        if s_new < t_new:
            flag = True
if flag:
    print('Yes')
else:
    print('No')
Problem p02981 (python)

Fixed submission:
n, a, b=map(int, input().split())
res=min(n*a,b)
print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int, input().split()))
import numpy as np

y=np.repeat([1,-1]*(n-1))
y.append([1])
print(y)

for i in range(n):
	if i%2!=0:
		y[i]=-1

x2=np.array(x).T

for i in range(n):
	y2=np.roll(y,i)
	res=np.dot(y2,x2)
	print(res)

Buggy submission (verdict: Runtime Error):
n, a, b=list(input().sprit())
res=min(n*a,b)
print(res)
Problem p02993 (python)

Fixed submission:
pas=input()

x1=pas[0]
x2=pas[1]
x3=pas[2]
x4=pas[3]

res='Good'
if x1==x2: res='Bad'
if x2==x3: res='Bad'
if x3==x4: res='Bad'

print(res)

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

x1=pass[0]
x2=pass[1]
x3=pass[2]
x4=pass[3]

res='Good'
if x1=x2: res='Bad'
if x2=x3: res='Bad'
if x3=x4: res='Bad'

print(res)
Problem p02994 (python)

Fixed submission:
n, l = (int(i) for i in input().split())
ap=[]
 
for i in range(n):
	ap.append(l+i)
 
mn=min(map(abs,ap))
 
if mn not in ap:
	mn=-mn
 
res=int((l-1)*n+(1+n)*n/2-mn)
print(res)

Buggy submission (verdict: Runtime Error):
n, l = (int(i) for i in input().split())
ap=[]

for i in range(n):
	ap.append(l+i)

idx=ap.index(min(map(abs,ap)))

res=(l-1)*n+(1+n)*n/2-ap[idx]
print(res)

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

ap=[]

for i in range(n):
	ap[i]=l+i

idx=ap.index(min(abs(ap))

res=(l-1)*n+(1+n)*n/2-ap[idx]

print(res)
Problem p03000 (python)

Fixed submission:
n, x = (int(i) for i in input().split())

l = [int(i) for i in input().split()]

dis = 0
cnt = 1

for i in range(n):
	dis += l[i]
	cnt += 1
	if dis > x:
		cnt += -1
		break
        
print(cnt)

Buggy submission (verdict: Runtime Error):
n, x = (int(i) for i in input().split())
l = [[int(i) for i in input().split()] for i in range(n)]

dis = 0

for i in range(n):
  dis += l[i]
  if dis > x:
    print(i + 1)
    break
Problem p03005 (python)

Fixed submission:
n, k = (int(i) for i in input().split())

if k==1:
  dif=0
  
if k>1:
  dif=n-k
  
print(dif)

Buggy submission (verdict: Runtime Error):
#n:balls 

n, k = (int(i) for i in input().split()) 

if k==1:
	dif=0

if k>1:
	dif=n-k:

print(dif)
Problem p03061 (python)

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

import fractions as frc

y=[0]*n
z=[0]*n

cd=x[0]
for i in range(n):
	cd=frc.gcd(cd,x[i])
	y[i]=cd

#print(y)

cd=x[n-1]
for i in range(n-1,-1,-1):
	cd=frc.gcd(cd,x[i])
	z[i]=cd

#print(z)

res=[0]*n
for i in range(n):
	if i==0:
		res[0]=z[1]
	else:
		if i==n-1:
			res[n-1]=y[n-2]
		else:
			res[i]=frc.gcd(y[i-1],z[i+1])

#print(res)

print(max(res))

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

import numpy as np
import fractions as frc
from functools import reduce
from copy import deepcopy

x2=deepcopy(x)

def gcd_list(lst):
    return reduce(frc.gcd, lst)

while True:
	n=len(x)
	g=[]
	if n<=5:
		if n==2:
			res=max(x)
			break
		else:
			for i in range(n):
				f=[]
				for j in range(n):
					if j!=i:            
						f.append(x[j])
				g.append(gcd_list(f))
			idx=np.argmax(g)
			rm=x[idx]
			x3=[c for c in x2 if c!=rm]
			res=gcd_list(x3)
			break
	sp=n//2
	y=x[:sp]
	z=x[sp:]
	y_gcd=gcd_list(y)
	z_gcd=gcd_list(z)
	if y_gcd>z_gcd:
		x=z
	else:
		x=y

print(res)

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

import numpy as np
import fractions as frc
from functools import reduce
from copy import deepcopy

x2=deepcopy(x)

def gcd_list(lst):
    return reduce(frc.gcd, lst)

while True:
	n=len(x)
	g=[]
	if n<=5:
		if n==2:
			res=max(x)
			break
		else:
			for i in range(n):
				f=[]
				for j in range(n):
					if j!=i:            
						f.append(x[i])
				g.append(gcd_list(f))
			idx=np.argmax(g)
			rm=x[idx]
			x3=[c for c in x2 if c!=rm]
			res=gcd_list(x3)
			break
	sp=n//2
	y=x[:sp]
	z=x[sp:]
	y_gcd=gcd_list(y)
	z_gcd=gcd_list(z)
	if y_gcd>z_gcd:
		x=z
	else:
		x=y

print(res)

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

import numpy as np
import fractions as frc
from functools import reduce
from copy import deepcopy

x2=deepcopy(x)

def gcd_list(lst):
    return reduce(frc.gcd, lst)

while True:
	n=len(x)
	g=[]
	if n<=5:
		if n==2:
			res=max(x)
			break
		else:
			for i in range(n):
				f=[c for c in x if c!=x[i]]
				g.append(gcd_list(f))
			idx=np.argmax(g)
			rm=x[idx]
			x3=[c for c in x2 if c!=rm]
			res=gcd_list(x3)
			break
	sp=n//2
	y=x[:sp]
	z=x[sp:]
	y_gcd=gcd_list(y)
	z_gcd=gcd_list(z)
	if y_gcd>z_gcd:
		x=z
	else:
		x=y

print(res)
Problem p03087 (python)

Fixed submission:
sn,qn=map(int,input().split())
s=input()
x=list(list(map(int,input().split())) for _ in range(qn))

s2=[0]*sn

for i in range(sn-1):
	if s[i]=='A' and s[i+1]=='C':
		s2[i+1]=s2[i]+1
	else:
		s2[i+1]=s2[i]

for i in range(qn):
	res=s2[x[i][1]-1]-s2[x[i][0]-1]
	print(res)

Buggy submission (verdict: Runtime Error):
sn,qn=map(int,input().split())
s=input()
x=list(list(map(int,input().split())) for _ in range(qn))

import math

s2=[0]*(sn+1)

for i in range(sn):
	if s[i]=='A' and s[i+1]=='C':
		s2[i]=0.5
		s2[i+1]=0.5

al=sum(s2)

for i in range(qn):
	res=al-math.ceil(sum(s2[:x[i][0]-1]))-math.ceil(sum(s2[x[i][1]:]))
	print(int(res))
Problem p03240 (python)

Fixed submission:
n=int(input())

x=[list(map(int,input().split())) for _ in range(n)]

for i in range(101):
	for j in range(101):
		for k in range(n):
			if x[k][2]>0:
				h=x[k][2]+abs(i-x[k][0])+abs(j-x[k][1])
				break
		chk=0
		for k in range(n): 
			if x[k][2]!=max(h-abs(i-x[k][0])-abs(j-x[k][1]),0):
				chk=1
				break
		if chk==0:
			res=[i,j,h]
			break
	if chk==0:
		break

print(*res)

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

x=[list(map(int,input().split())) for _ in range(n)]

for i in range(101):
	for j in range(101):
		for k in range(n):
			if x[k][2]>0:
				h=x[k][2]+abs(i-x[k][0])+abs(j-x[k][1])
			break
		chk=0
		for k in range(n): 
			if x[k][2]!=max(h-abs(i-x[k][0])-abs(j-x[k][1]),0):
				chk=1
				break
		if chk==0:
			res=[i,j,h]
			break
	if chk==0:
		break

print(*res)
Problem p03244 (python)

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

import collections as col

x_e=[]
x_o=[]

for i in range(n):
	if i%2==0:
		x_e.append(x[i])
	else:
		x_o.append(x[i])

x_e_c=col.Counter(x_e).most_common()    
x_o_c=col.Counter(x_o).most_common()

if x_e_c[0][1]>x_o_c[0][1]:
	fst=x_e_c
	snd=x_o_c
else:
	if x_e_c[0][1]<x_o_c[0][1]:	
		fst=x_o_c
		snd=x_e_c
	else:
		if len(x_e_c)>1 and len(x_o_c)>1:
			if x_e_c[1][1]<=x_o_c[1][1]:	
				fst=x_e_c
				snd=x_o_c
			else:
				fst=x_o_c
				snd=x_e_c
		else:
			fst=x_o_c
			snd=x_e_c

res=0

res+=n//2-fst[0][1]
if fst[0][0]!=snd[0][0]:
	res+=n//2-snd[0][1]
else:
	if len(snd)>1:
		res+=n//2-snd[1][1]
	else:
		res+=n//2

print(res)

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

import collections as col

x_e=[]
x_o=[]

for i in range(n):
	if i%2==0:
		x_e.append(x[i])
	else:
		x_o.append(x[i])

x_e_c=col.Counter(x_e).most_common()    
x_o_c=col.Counter(x_o).most_common()

if x_e_c[0][1]>x_o_c[0][1]:
	fst=x_e_c
	snd=x_o_c
else:
	if x_e_c[0][1]<x_o_c[0][1]:	
		fst=x_o_c
		snd=x_e_c
	else:
		if x_e_c[1][1]<=x_o_c[1][1]:	
			fst=x_e_c
			snd=x_o_c
		else:
			fst=x_o_c
			snd=x_e_c

res=0

res+=n//2-fst[0][1]
if fst[0][0]!=snd[0][0]:
	res+=n//2-snd[0][1]
else:
	if len(snd)>1:
		res+=n//2-snd[1][1]
	else:
		res+=n//2

print(res)

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

import collections as col

x_e=[]
x_o=[]

for i in range(n):
	if i%2==0:
		x_e.append(x[i])
	else:
		x_o.append(x[i])

x_e_c=col.Counter(x_e).most_common()    
x_o_c=col.Counter(x_o).most_common()

if x_e_c[0][1]>x_o_c[0][1]:
	fst=x_e_c
	snd=x_o_c
else:
	if x_e_c[0][1]<x_o_c[0][1]:	
		fst=x_o_c
		snd=x_e_c
	else:
		if x_e_c[1][1]<=x_o_c[1][1]:	
			fst=x_e_c
			snd=x_o_c

res=0

res+=n//2-fst[0][1]
if fst[0][0]!=snd[0][0]:
	res+=n//2-snd[0][1]
else:
	if len(snd)>1:
		res+=n//2-snd[1][1]
	else:
		res+=n//2

print(res)
Problem p03280 (python)

Fixed submission:
r,c=map(int,input().split())
res=(r-1)*(c-1)
print(res)

Buggy submission (verdict: Runtime Error):
s=str(input())
k=int(input())

res=''

if len(s)>=k:
	for i in range(k):
		if s[i]!=1:
			res=s[i]			
			break
		if i==k-1:
			res='1'
else:
	for i in range(len(s)):
		if s[i]!='1':
			res=s[i]
			break

print(res)
Problem p03284 (python)

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

res=1

if n%k==0:
	res=0

print(res)

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

res='No'

if t>3 and (t%4==0 or t%7==0 or t%4==3 or t%7==4):
	res='Yes'

print(res)
Problem p03290 (python)

Fixed submission:
n, s=map(int,input().split())
q=[list(map(int, input().split())) for i in range(n)]

import numpy as np
import itertools
import pprint

bit=[0,1]

cmp=list(itertools.product(bit, repeat=n))

cp=[0]*n
qt=[0]*n
cnt=[0]*2**n

for i in range(n):
	cp[i]=100*(i+1)*q[i][0]+q[i][1]
	qt[i]=q[i][0]

cmp_cnt=np.dot(np.array(qt),np.array(cmp).T)

for i in range(2**n):
	score=np.dot(np.array(cp),np.array(cmp[i]).T)
	cnt[i]=cmp_cnt[i]
	if score<s:
		j=n-1
		while score<s and j>=0:
			if cmp[i][j]==0:
				for k in range(qt[j]):
					score+=(j+1)*100
					cnt[i]+=1
					if score>=s:
						j=0
						break
			j-=1
                
print(min(cnt))

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

import numpy as np
import copy

dt=[0]*n
cp=[0]*n
ck=[0]*n

for i in range(n):
	dt[i]=100*(i+1)+q[i][1]//q[i][0]
	cp[i]=100*(i+1)*q[i][0]+q[i][1]

score=sum(cp)
cnt=np.sum(q, axis=0)[0]

for i in range(n):
	id=np.argmin(dt)
	score-=cp[id]
	cnt-=q[id][0]
	dt[id]=999999999
	ck[id]=i+1
	if score<=s:
		break

cnt1=999
for i in range(n):
	if dt[i]==999999999:
		if cp[i]+score>=s:
			cnt1=min(cnt1,q[i][0])

res1=cnt+cnt1

for i in range(n):
	if ck[n-1-i]>0:
  		id2=n-1-i
  		break

for i in range(q[id2][0]):
	score+=(id2+1)*100
	if score>=s:
		res2=cnt+i+1
		break

print(min(res1,res2))
Problem p03316 (python)

Fixed submission:
n=input()
sm=0
 
for i in range(len(n)):
	sm+=int(n[i])

res='No'
 
if int(n)%sm==0:
	res='Yes'

print(res)

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

sm=0

fot i in range(10):
	sm+=n[i]

res='No'

if n%sm==0:
	res='Yes'

print(res)
Problem p03324 (python)

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

res=100**x*y

if y==100:
	res=100**x*(y+1)

print(res)

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

res=100**x*y

if y=100:
	res=100**x*(y+1)

print(res)
Problem p02801 (python)

Fixed submission:
print(chr(ord(input()) + 1))

Buggy submission (verdict: Runtime Error):
print(char(ord(input()) + 1))

Buggy submission (verdict: Runtime Error):
char(ord(input()) + 1)
Problem p04044 (python)

Fixed submission:
n, m = map(int, input().split())
print(''.join(sorted(input() for _ in range(n))))

Buggy submission (verdict: Runtime Error):
print(''.join(sorted(input() for _ in range(int(input())))))
Problem p02952 (python)

Fixed submission:
n = int(input())
count = 0
for i in range(n):
  if len(str(i+1))%2 == 1:
    count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
count = 0
for i in range(n):
  if len(i+1)%2 == 1:
    count += 1

print(count)
Problem p02801 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 12 22:19:09 2020

@author: nanasakiwataru
"""

C = input()
ans = chr(ord(C) + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 12 22:19:09 2020

@author: nanasakiwataru
"""


ans = chr(ord(C) + 1)
st = C + 'の次は' + ans + 'です。'
print(st)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 12 22:19:09 2020

@author: nanasakiwataru
"""

def alphabet(C):
    ans = chr(ord(C) + 1)
    st = C + 'の次は'+ n + 'です。'
    return  st

n = alphabet('a')
print(n)
Problem p02801 (python)

Fixed submission:
x = input()
z = ord(x)
xi = chr(z+1)
print(xi)

Buggy submission (verdict: Runtime Error):
x = input()
z = [a,b,c,d,e,f,g,h,i,j,k,l,n,m,o,p,q,r,s,t,u,v,w,x,y,z]
xi = z.index(x)
print(z[xi+a1])
Problem p02801 (python)

Fixed submission:
alpha = 'abcdefghijklmnopqrstuvwxyz'
C = input()
print(alpha[alpha.index(C)+1])

Buggy submission (verdict: Runtime Error):
alpha = 'abcdefghijklmnopqrstuvwxyz'
C = input().split()
print(alpha[alpha.index(C)+1])

Buggy submission (verdict: Runtime Error):
import sys
import string
input = sys.stdin.readline

C = input()
print(string.ascii_lowercase[string.ascii_lowercase.index(C)+1])

Buggy submission (verdict: Runtime Error):
import sys
import string
input = sys.stdin.readline

C = input()
if C == 'z': print('a')
else: print(string.ascii_lowercase[string.ascii_lowercase.index(C)+1])
Problem p02801 (python)

Fixed submission:
str = input()
alp = "abcdefghijklmnopqrstuvwxyz"
print(alp[ord(str)-96])

Buggy submission (verdict: Runtime Error):
import sys

str = sys.stdin.readline()
alp = "abcdefghijklmnopqrstuvwxyz"
print(alp[ord(str)-96])

Buggy submission (verdict: Runtime Error):
import sys

str = sys.stdin.readlines()[0]
alp = "abcdefghijklmnopqrstuvwxyz"
print(alp[ord(str)-96])
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
count = 0
for i in range(3):
    if s[i]==t[i]:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
str = input().split("\r\n")
count = 0
for i in range(3):
    if str[0][i]==str[1][i]:
        count += 1

print(count)
Problem p03060 (python)

Fixed submission:
n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
result = 0
for v, c in zip(value, cost):
  if v > c:
    result += v-c
print(result)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))

idx = range(n)
result = [0, sum(value)-sum(cost)]
index = [idx for idx, v, c in enumerate(zip(value, cost)) if v > c]
comb = [com for i in range(1, len(index)) for com in combinations(index, i)]

for com in comb:
  tmp = 0
  for c in com:
    tmp += value[c]-cost[c]
  result.append(tmp)
    
print(max(result))
Problem p03555 (python)

Fixed submission:
row1 = input()
row2 = input()
if row1[0] == row2[2] and row1[1] == row2[1] and row1[2] == row2[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
import numpy
row1 = input()
row2 = input()
if row1[0] == row2[2] and row1[1] == row2[1] and row1[2] == row2[0]:
  print('YES')
print('NO)
Problem p03563 (python)

Fixed submission:
r = int(input())
g = int(input())

print(g*2-r)

Buggy submission (verdict: Runtime Error):
words = input()
key = input()
for i in range(len(words)):
    if words[i:i+len(key)] == key:
         words[i:i+len(key)] = key
         print(words.replace('?', 'a'))
else:
    print('UNRESTORABLE')
Problem p03573 (python)

Fixed submission:
nums = map(int, input().split())
d = {}
for n in nums:
  d.setdefault(n, 0)
  d[n] += 1
print(list(d.keys())[list(d.values()).index(1)])

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

nums = input().split()
set_nums = list(set(nums))
other = sum(nums) - sum(set_nums)
set_nums.remove(other)
print(set_nums[0])

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

nums = input()
set_nums = list(set(nums))
other = sum(nums) - sum(set_nums)
set_nums.remove(other)
print(set_nums[0])

Buggy submission (verdict: Runtime Error):
nums = input()
set_nums = list(set(nums))
other = sum(nums) - sum(set_nums)
set_nums.remove(other)
print(set_nums[0])

Buggy submission (verdict: Runtime Error):
nums = input()
set_nums = list(set(nums))
other = sum(nums) - sum(set_nums)
del set_nums[other]
print(set_nums[0])

Buggy submission (verdict: Runtime Error):
nums = input()
print(sum(nums) - sum(set(nums)))

Buggy submission (verdict: Runtime Error):
nums = input()
print(sum(nums)-sum(set(nums)))

Buggy submission (verdict: Runtime Error):
nums = input().strip().split()
print(sum(nums)-sum(set(nums)))

Buggy submission (verdict: Runtime Error):
nums = map(int, input().split())
print(sum(nums)-set(nums))
Problem p03574 (python)

Fixed submission:
h, w = list(map(int, input().split()))
a = [input() for i in range(h)]
x_ = [-1, -1, -1, 0, 0, 1, 1, 1]
y_ = [-1, 0, 1, -1, 1, -1, 0, 1]
result = [['0' for i in range(w)] for j in range(h)]
for i in range(h):
  for j in range(w):
    count = 0
    if a[i][j] == '#':
      result[i][j] = '#'
      continue
    for k in range(8):
      x = i+x_[k]
      y = j+y_[k]
      if x<0 or y<0 or x>=h or y>=w:
        continue
      elif a[x][y] == '#':
        count += 1
    result[i][j] = str(count)
for i in result:
  print(''.join(i))

Buggy submission (verdict: Runtime Error):
h, w = input().split()
for i in range(int(h)):
  row = [input() for i in range(int(w))]
print(row)
Problem p03795 (python)

Fixed submission:
num = int(input())
get = num // 15

print((num * 800) - (get * 200))

Buggy submission (verdict: Runtime Error):
num = input()
get = num // 15

print((num * 800) - (get * 200))

Buggy submission (verdict: Runtime Error):
num = input()
get = num / 15
print((num * 800) - (get * 200))

Buggy submission (verdict: Runtime Error):
num = input()
get = num // 15
print(num * 800 - get * 200)
Problem p03826 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

a, b, c, d = map(int, input().strip().split())
print(max(a*b, c*d))

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

print(max((a * b), (c * d)))