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

Fixed submission:
N,C=map(int, input().split())
D=[tuple(map(int, input().split())) for _ in range(C)]
c = [[0 for i in range(C)] for j in range(3)]
for j in range(N):
    i=0
    for v in list(map(int, input().split())):
        c[(i+j)%3][v-1] += 1
        i += 1

ans = float("inf")
for i in range(C):
    for j in range(C):
        if i!=j:
            for k in range(C):
                if i!=k and j!=k:
                    tmp = 0
                    for l in range(C):
                        tmp+=D[l][i]*c[0][l]
                    for l in range(C):
                        tmp+=D[l][j]*c[1][l]
                    for l in range(C):
                        tmp+=D[l][k]*c[2][l]
                    if tmp<ans:
                        ans=tmp

print(ans)

Buggy submission (verdict: Runtime Error):
N,C=map(int, input().split())
D=[tuple(map(int, input().split())) for _ in range(C)]
c = [[0 for _ in range(3)] for _ in range(C)]
for j in range(N):
    i=0
    for v in map(int, input().split()):
        c[(i+j)%3][v-1] += 1
        i += 1

ans = float("inf")
for i in range(C):
    for j in range(C):
        if i!=j:
            for k in range(C):
                if i!=k and j!=k:
                    tmp = 0
                    for l in range(C):
                        tmp+=D[l][i]*c[0][l]
                    for l in range(C):
                        tmp+=D[l][j]*c[1][l]
                    for l in range(C):
                        tmp+=D[l][k]*c[2][l]
                    if tmp<ans:
                        ans=tmp

print(ans)
Problem p03455 (python)

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

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

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

if a*b%2 == 0:
    print('Even')
else
    print('Odd')
sys.exit(0)
Problem p03555 (python)

Fixed submission:
c = [input() for _ in range(2)]
if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
    print("YES")
else:
    print("NO")

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

import bisect

ans = 0
for b in B:
    a = bisect.bisect_left(A,b)
    c = n - bisect.bisect_right(C,b)
    ans += a*c

print(ans)
Problem p04032 (python)

Fixed submission:
import sys
s = input()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if i < len(s)-2:
        if s[i] == s[i+2]:
            print(i+1, i+3)
            sys.exit(0)
print("-1 -1")
sys.exit(0)

Buggy submission (verdict: Runtime Error):
import sys
s = input()

if len(s) == 2 and s[0] == s[1]:
    print("0, 1")
    sys.exit(0)

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if s[i] == s[i+2]:
        print(i+1, i+3)
        sys.exit(0)
if s[i+1] == s[i+2]:
    print(i+2, i+3)
    sys.exit(0)
print("-1 -1")
sys.exit(0)

Buggy submission (verdict: Runtime Error):
import sys
s = input()

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if s[i] == s[i+2]:
        print(i+1, i+3)
        sys.exit(0)
if s[i+1] == s[i+2]:
    print(i+2, i+3)
    sys.exit(0)
print("-1 -1")
sys.exit(0)

Buggy submission (verdict: Runtime Error):
import sys
s = list(input())

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if s[i] == s[i+2]:
        print(i+1, i+3)
        sys.exit(0)
if s[i+1] == s[i+2]:
    print(i+2, i+3)
    sys.exit(0)
print("-1 -1")
sys.exit(0)
Problem p03264 (python)

Fixed submission:
import math
K = int(input())
all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(int(answer))

Buggy submission (verdict: Runtime Error):
import math
K = input()
all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(answer)

Buggy submission (verdict: Runtime Error):
import math

all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(answer)

Buggy submission (verdict: Runtime Error):
import math

all_number =  K * K
even_number =  math.floor(all_number/2)*math.floor(all_number/2)
odd_number = math.ceil(all_number/2)*math.ceil(all_number/2)
answer = (all_number - even_number - odd_number)/2
Problem p03323 (python)

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

for i in range(16):
    if i % 2 == 0 and A > 0:
        A -= 1
    elif i % 2 == 1 and B > 0:
        B -= 1

if A == 0 and B == 0:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import numpy as np

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

scores = []
for _ in range(N):
    scores.append(list(map(int, input().split())))

scores = np.array(scores)
signs = [-1, 1]
answer = 0
for sign_k in signs:
    kireisa = sign_k
    for sign_o in signs:
        oishisa = sign_o
        for sign_n in signs:
            ninki = sign_n

            kireisa_score = scores[:, 0] * kireisa
            oishisa_score = scores[:, 1] * oishisa
            ninki_score = scores[:, 2] * ninki

            sorted_score = np.stack((kireisa_score, oishisa_score, ninki_score), axis=1)
            sums = [sum(s) for s in sorted_score]

            sums.sort()
            sums.reverse()
            if sum(sums[:M]) > answer:
                answer = sum(sums[:M])

print(answer)
Problem p03292 (python)

Fixed submission:
a = list(map(int, input().split())) 
a.sort()
for i in range(len(a)):
  if i == 0:
    res = 0
  else :
    res += a[i]-a[i-1]
print(res)

Buggy submission (verdict: Runtime Error):
a = map(int,raw_input().split())
a.reverse()
for i in range(len(a)):
  if i == 0:
    res = 0
  else :
    res += a[i-1]-a[i]
print(res)

Buggy submission (verdict: Runtime Error):
a = map(int,raw_input().split())
a.reverse()
for i in range(len(a)):
  if i == 0:
    res = 0
  else :
    res += a[i]-a[i-1]
print(res)

Buggy submission (verdict: Runtime Error):
a = map(int,raw_input().split())
a.reverse()
for i in range(len(a)):
  if == 0:
    res = 0
  else :
    res += a[i]-a[i-1]
print(res)
Problem p03264 (python)

Fixed submission:
import sys, math
from sys import stdin, stdout
rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6+5)
#from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))
take = lambda: map(int, stdin.readline().strip().split())
from bisect import bisect_left,bisect_right

k=input()
print (k/2*(k-k/2))

Buggy submission (verdict: Runtime Error):
import sys, math
from sys import stdin, stdout
rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6+5)
#from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))
take = lambda: map(int, stdin.readline().strip().split())
from bisect import bisect_left,bisect_right

x1,y1,x2,y2=take()

if x1==x2:
    diff=y1-y2
    print x2+diff,y2,x1+diff,y1
else:
    diff=x1-x2
    print x2,y2-diff,x1,y1-diff

Buggy submission (verdict: Runtime Error):
import sys, math
from sys import stdin, stdout
rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6+5)
from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))
take = lambda: map(int, stdin.readline().strip().split())
from bisect import bisect_left,bisect_right

k=input()
print (k/2*(k-k/2))
Problem p03323 (python)

Fixed submission:
import sys, math
from sys import stdin, stdout

rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())


a,b=take()
if a<=8 and b<=8:
    print 'Yay!'
    exit()
print ':('

Buggy submission (verdict: Runtime Error):
import sys, math
from sys import stdin, stdout

rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())


a=input()
b=input()
if a<=8 and b<=8:
    print 'Yay!'
    exit()
print ':('
Problem p03373 (python)

Fixed submission:
import sys
from sys import stdin, stdout
import math
from copy import deepcopy
rem=10**9+7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())

a,b,c,x,y=take()
ans=10**12
d=max(x,y)*2
new=[]
while(d>=0):
    i=d/2
    j=d/2
    if i>=x:
        one=0
    else:
        one=(x-i)*a
    if j>=y:
        two=0
    else:
        two=(y-i)*b
    new.append(one+two+d*c)
    d-=1
print min(new)

Buggy submission (verdict: Runtime Error):
import sys
from sys import stdin, stdout,maxint
import math
from copy import deepcopy
rem=10**9+7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())



n,c=take()
ans=[]
ans2=[]
ans1=[]
ans3=[]
u=[0]
f=[0]
all=[[0,0]]
rev=[[0,0]]
for i in range(n):
    a,b=take()
    all.append([a,b])
    rev.append([c-a,b])
all.sort()
rev.sort()
#print all,rev
tot=0
en=0
for i in all:
    a,b=i
    tot+=b
    en=tot
    ans.append(en-a)
    ans1.append(en-2*a)

tot=0
en=0
for i in rev:
    a,b=i
    tot += b
    en = tot
    ans2.append(en - a)
    ans3.append(en-2*a)

fin=0
#print all,rev
#print ans,ans2
t=0
k=0
for i in range(len(ans)):
    t=max(t,ans[i])
    u.append(t)
    k=max(k,ans2[i])
    f.append(k)

#print ans,ans1,ans2,ans3,f
for i in range(n):
    fin=max(fin,ans1[i]+f[n-i])
    fin=max(fin,ans3[i]+u[n-i])
print fin

Buggy submission (verdict: Runtime Error):
import sys
from sys import stdin, stdout,maxint
import math
from copy import deepcopy
rem=10**9+7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())



n,c=take()
ans=[]
ans2=[]
ans1=[]
ans3=[]
u=[0]
f=[0]
all=[[0,0]]
rev=[[0,0]]
for i in range(n):
    a,b=take()
    all.append([a,b])
    rev.append([c-a,b])
all.sort()
rev.sort()
#print all,rev
tot=0
en=0
for i in all:
    a,b=i
    tot+=b
    en=tot
    ans.append(en-a)
    ans1.append(en-2*a)

tot=0
en=0
for i in rev:
    a,b=i
    tot += b
    en = tot
    ans2.append(en - a)
    ans3.append(en-2*a)

fin=0
#print all,rev
#print ans,ans2
t=0
k=0
for i in range(len(ans)):
    t=max(t,ans[i])
    u.append(t)
    k=max(k,ans2[i])
    f.append(k)

#print ans,ans1,ans2,ans3,f
for i in range(n):
    fin=max(fin,ans1[i]+f[n-i])
    fin=max(fin,ans3[i]+u[n-i])
print fin
Problem p03309 (python)

Fixed submission:
n = int(input())
l = input().split()
lst = list(map(int,l))
x = []

for i in range(n):
    x.append(0)
    x[i] = lst[i] - (i+1)

#print(x)
x.sort()
#print(x)

b = x[n//2]

#print(b)

sad = 0

#print(lst)

for i in range(n):
    sad += abs(lst[i]-b-i-1)

print(sad)

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

sum = 0
j = 1
for i in lst:
    sum += (i-j)
    j+=1

//四捨五入
b = round(sum/n)

#print(b)

j = 1
sad = 0
for a in lst:
    sad += abs(a-(b+j))
    j += 1
print(sad)
Problem p03319 (python)

Fixed submission:
N,K = map(int, input().split())
print(-(-(N-1)//(K-1)))

Buggy submission (verdict: Runtime Error):
print(-(-(N-1)//(K-1)))
Problem p03324 (python)

Fixed submission:
D,N = map(int, input().split())

if N == 100:
    print(100 ** D * (N+1))
else:
    print(100 ** D * N)

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

if N == 100:
    print(101 ** D * n)
else:
    print(100 ** D * N)
Problem p03284 (python)

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

ans = 0
if n % k == 0:
    ans = 0
else:
    ans = 1

print(str(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
 
for i in range(n//4+1):
    for j in range(n//7+1):
        if n == 4*i+7*j:
            print('Yes')
            exit(0)
print('No')
Problem p03280 (python)

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

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

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

print((a - 1) * (b - 1))
Problem p03331 (python)

Fixed submission:
n = int(input())

ans = list()

for i in range(2, n // 2):
    a = sum([int(j) for j in str(i)])
    b = sum([int(j) for j in str(n - i)])
    ans.append(a + b)

if len(ans) > 0:
    print(min(ans))
else:
    print(2)

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

ans = list()

for i in range(2, n):
    a = sum([int(j) for j in str(i)])
    b = sum([int(j) for j in str(n - i)])
    ans.append(a + b)

print(min(ans))
Problem p03338 (python)

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

ans = list()

for i in range(len(s)):
    cnt = 0
    x = sorted(set(s[:i]), key=s.index)
    y = sorted(set(s[i:]), key=s.index)
    for j in x:
        if j in y:
            cnt += 1
    ans.append(cnt)

print(max(ans))

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

ans = list()

for i in range(1, len(s) // 2):
    cnt = 0
    x = sorted(set(s[:i]), key=s.index)
    y = sorted(set(s[i:]), key=s.index)
    for j in x:
        if y.count(j) > 0:
            cnt += 1
    ans.append(cnt)

print(max(ans))
Problem p03309 (python)

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


import statistics
import math
def kanashimi(b):
    
    out = 0
    for i in range(N):
        out = out + abs(A[i]-(b+(i+1)))
    return out 
  
B = [A[i]-(i+1) for i in range(N)]
b = statistics.median(B)

print(int(kanashimi(b)))

Buggy submission (verdict: Runtime Error):
import math

def kanashimi(b):
    
    out = 0
    for i in range(N):
        out = out + abs(A[i]-(b+(i+1)))
    return out 
ans = 10**20
for i in range(-100,100):
    ans = min(ans,kanashimi(i))
print(ans)
Problem p03353 (python)

Fixed submission:
s= str(input().strip())
K= int(input().strip())
parts = []
for i in range(len(s)+1):
    for j in range(i+1,len(s)+1):
        flg = 0
        if j-i > K:
            break
        parts.append(s[i:j])
v = sorted(parts)
vv = [v[0]]
tmp = v[0]
for k in range(1,len(v)):
    if v[k]!=tmp:
        vv.append(v[k])
        tmp = v[k]
    if len(vv)==K:
        break
        
print(vv[K-1])

Buggy submission (verdict: Runtime Error):
s= str(input().strip())
K= int(input().strip())
parts = []
for i in range(len(s)+1):
    for j in range(i+1,len(s)+1):
        flg = 0
        if j-i > K:
            break
        parts.append(s[i:j])
v = sorted(parts)
vv = [v[0]]
tmp = v[0]
for k in range(1,len(v)):
    if v[k]!=tmp:
        vv.append(v[k])
        tmp = v[k]
    if len(vv)==K:
        break
        
print(vv[K])
Problem p03363 (python)

Fixed submission:
import collections
N = int(input().strip())
A = list(map(int, input().strip().split(' ')))
C = [0 for j in range(N)]
C[0] = A[0]
for i in range(1,N):
        C[i] = C[i-1] + A[i]
C.sort()

CC = collections.Counter(C)

result = CC[0]
for k in CC.values():
    if k > 1:
        result = result + k*(k-1)/2

print(int(result))

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
N = int(input().strip())
A = list(map(int,input().strip().split(' ')))
Z = np.zeros((N+1,N))
Z[0,:] = np.array(A)
result = 0

for i,j in itertools.combinations_with_replacement(range(1,N),2):
        tmp = Z[i-1,j-1]+Z[0,j]
        if tmp ==0:
                result = result+1
        Z[i,j] = tmp
print(result)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
N = int(input().strip())
A = list(map(int,input().strip().split(' ')))
Z = np.zeros((N+1,N))
Z[0,:] = np.array(A)
result = 0

for i,j in itertools.combinations_with_replacement(range(1,N),2):
        tmp = Z[i-1,j-1]+Z[0,j]
        if tmp ==0:
                result = result+1
        Z[i,j] = tmp
print(result)
Problem p03380 (python)

Fixed submission:
import numpy as np

n = int(input().strip())
A = list(map(int,input().strip().split(' ')))
sorted_A = sorted(A)
ai=sorted_A[-1]
print(ai)
del sorted_A[-1]
tmplist=np.array([min(i,ai-i) for i in sorted_A])
maxidx = np.argmax(tmplist)

print(sorted_A[int(maxidx)])

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

import numpy as np
sortA = np.array(sorted(A))
a_large = sortA[-1]
sortA = np.delete(sortA,-1,0)
half_of_a_large = np.array([a_large/2 for i in range(N-1)])
a_small = sortA[np.argmin(abs(sortA-half_of_a_large))]
print(a_large,a_small)a
Problem p03386 (python)

Fixed submission:
A, B, K = list(map(int, input().strip().split(' ')))
for j in range(A,min(A+K,B+1)):
    if not(j >= A+K and j <= B-K):
        print(j)
for i in range(max(B-K,j+1),B+1):
    if not(i >= A+K and i <= B-K):
        print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = list(map(int, input().strip().split(' ')))
tmplist = list([i for i in range(A,B+1)])
for j in range(len(tmplist)):
    if tmplist[j] > A+K and tmplist[j] < B-K:
        tmplist.pop(j)

for k in tmplist:
    print(k)
Problem p03591 (python)

Fixed submission:
S = str(input().strip())
if S[:4] == 'YAKI':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
H,W = list(map(int,input().strip().split(' ')))
A=[str(input().strip()) for i in range(H)]

import collections
flg = 1
flg1 = 0
S = [[s for s in a] for a in A]
for s in S:
    c = collections.Counter(s)
    for i in c.values():
        if i % 2 != 0 and len(c.keys()) != 1:
            flg1 = flg1 + 1
            if W % 2 == 0 and flg1 >= 1:
                flg = 0
                break
            elif W % 2 != 0 and flg1 >= 2:
                flg = 0
                break

if flg == 1:    
    S_t = [list(x) for x in zip(*S)]
    for s in S_t:
        c = collections.Counter(s)
        for i in c.values():
            if i % 2 != 0 and len(c.keys()) != 1:
                flg1 = flg1 + 1
                if H % 2 == 0 and flg1 >= 1:
                    flg = 0
                    break
                elif H % 2 != 0 and flg1 >= 2:
                    flg = 0
                    break

if flg == 1:
    print('Yes')
else:
    print('No')
Problem p03737 (python)

Fixed submission:
s1,s2,s3 = map(str, input().split())
print(s1.upper()[0]+s2.upper()[0]+s3.upper()[0])

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>B:
    print('GREATER')
elif A<B:
    print('LESS')
else:
    print('EQUAL')
Problem p03738 (python)

Fixed submission:
A=int(input())
B=int(input())
if A>B:
    print('GREATER')
elif A<B:
    print('LESS')
else:
    print('EQUAL')

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
if A>B:
    print('GREATER')
elif A<B:
    print('LESS')
else:
    print('EQUAL')
Problem p03294 (python)

Fixed submission:
from functools import reduce

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

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

c = lcm_list(a) - 1

f = 0
for i in a:
    f += c % i

print(f)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

c = lcm_list(a) - 1

f = 0
for i in a:
    f += c % i

print(f)
Problem p03328 (python)

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

k = b - a - 1

a_i = 0
for i in range(1, b - a):
    a_i += i

print(a_i - a)

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

max_n = 0

for i in range(1,n):
    x = set()
    y = set()
    for j in range(0,i):
        x.add(s[j])
    for j in range(i,n):
        y.add(s[j])

    if len(x|y) > max_n:
        max_n = len(x|y)

print(max_n)
Problem p03351 (python)

Fixed submission:
a, b, c, d = [int(i) for i in input().split()]

if (abs(a-b) <= d and abs(b-c) <= d) or abs(a-c) <= d:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
s=input()
K=int(input())


def calc(s, K):
    a = defaultdict(list)
    for i, c in enumerate(s):
        a[c].append(i)
    result = set()
    for i in range(ord('a'), ord('z')+1):
        for j in a[chr(i)]:
            for l in range(min(K, len(s[j:]))):
                result.add(s[j:j+l+1])
        if len(result) >= K:
            return sorted(list(result))[K-1]

print(calc(s, K))
Problem p03352 (python)

Fixed submission:
x=int(input())
result = [1]

for i in range(2, x):
    sum = i
    while sum * i <= x:
        sum = sum * i
        result.append(sum)

print(sorted(result)[-1])

Buggy submission (verdict: Runtime Error):
x=int(input())
result = []

for i in range(2, x):
    sum = i
    while sum * i <= x:
        sum = sum * i
        result.append(sum)

print(sorted(result)[-1])

Buggy submission (verdict: Runtime Error):
x=int(input())
result = []

for i in range(2, x):
    sum = i
    while sum * i <= 1000:
        sum = sum * i
        result.append(sum)

print(sorted(result)[-1])
Problem p03694 (python)

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

print(max(coords) - min(coords))

Buggy submission (verdict: Runtime Error):
input()
coords = input.split()
print(max(coords) - min(coords))
Problem p03281 (python)

Fixed submission:
a = int(input())
result = 0
for i in range(0, a):
    tmp = 0
    if (i+1) % 2 != 0:
        for j in range(0, i):
            if (i + 1) % (j + 1) == 0:
                tmp += 1
        if tmp == 7:
            result += 1

print(result)

Buggy submission (verdict: Runtime Error):
a = int(input())
result = 0
for i in range(0, a):
    tmp = 0
    for j in range(0, i):
        if i % j == 0:
            tmp += 1
    if tmp == 8:
        result += 1

print(result)
Problem p03284 (python)

Fixed submission:
n = str(input())
[n, k] = list(map(int,n.split(" ")))
if n % k == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n = str(input())
list_n = n.split(" ")
n = list_n[0]
k = list_n[1]
if n % k == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n = str(input())
[n, k] = list(n.split(" "))
if n % k == 0:
    print(0)
else:
    print(1)
Problem p03292 (python)

Fixed submission:
input_s = str(input())
ary = input_s.split(" ")
ary.sort()
task = 0
tmp1 = 0
tmp2 = 0
for i in ary:
    if tmp1 == 0:
        tmp1 = int(i)
    else:
        tmp2 = int(i)
        if tmp1 < tmp2:
            task += tmp2 - tmp1
        else:
            task += tmp1 - tmp2
        tmp1 = tmp2
print(task)

Buggy submission (verdict: Runtime Error):
input_x = str(input())
input_y = str(input())
tmp = input_y
ary = list(input_y)
mongon = "Yes"
for c in input_x:
    idx = tmp.find(c)
    if idx == -1:
        mongon = "No"
        break
    else:
        ary.pop(idx)
        tmp = "".join(ary)


print(mongon)
Problem p03323 (python)

Fixed submission:
a,b = map(int,input().split())
if max(a,b) <= 8:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if max(a,b) <= 8:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if max(a,b) <= 6:
  print('Yay!')
else:
  print(':(')
Problem p03331 (python)

Fixed submission:
n = input()
a = 0
for i in range(len(n)):
    a += int(n[i])
if a == 1:
    print(10)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 0
for i in range(len(n)):
    a += n[i]
if a == 1:
    print(10)
else:
    print(a)
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
print(max([len(set(S[:i]).intersection(set(S[i:]))) for i in range(N)]))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
 print(max(a+b,max(a-b,a*b)))
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a<=b:
  return a
else:
  return a-1
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(i) for i in input().split()]
b=sorted(a)
m=int((n+1)//2)
s=0
for i in range(m):
  s+=b[2*i+1]
print(s)