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

Fixed submission:
# coding: utf-8

import sys

def _main():
    # args = sys.argv[1:]
    # args = [int(arg) for arg in args]
    text = input()
    datelist = text.split('/')
    year, month, day = [int(i) for i in datelist]

    if year< 2019:
        print('Heisei')
    elif year == 2019:
        if month<4:
            print('Heisei')
        elif month == 4:
            if day <= 30:
                print('Heisei')
            else:
                print('TBD')
        else:
            print('TBD')
    else:
        print('TBD')

if __name__ == '__main__':
    _main()

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

import sys

def _main():
    # args = sys.argv[1:]
    # args = [int(arg) for arg in args]
    datelist = sys.argv[1].split('/')
    year, month, day = [int(i) for i in datelist]

    if year< 2019:
        print('Heisei')
    elif year == 2019:
        if month<4:
            print('Heisei')
        elif month == 4:
            if day <= 30:
                print('Heisei')
            else:
                print('TBD')
        else:
            print('TBD')
    else:
        print('TBD')

if __name__ == '__main__':
    _main()
Problem p03192 (python)

Fixed submission:
print(input().count('2'))

Buggy submission (verdict: Runtime Error):
print(input().count())
Problem p03455 (python)

Fixed submission:
a,b = input().split(' ')
a = int(a)
b = int(b)
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a,b = input().split(' ')
if (a*b) % 2 == 1:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
a,b = input().split(' ')
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')
Problem p03729 (python)

Fixed submission:
a,b,c = input().split()
print('YES') if a[-1] == b[0] and b[-1] == c[0] else print('NO')

Buggy submission (verdict: Runtime Error):
,b,c = input().split()
print('YES') if a[-1] == b[0] and b[-1] == c[0] else print('NO')
Problem p03737 (python)

Fixed submission:
print(''.join([x[0].upper() for x in input().split()]))

Buggy submission (verdict: Runtime Error):
print([x[0].upper() for x in input().split()].join())
Problem p03777 (python)

Fixed submission:
a,b = input().split()
print('H') if a == b else print('D')

Buggy submission (verdict: Runtime Error):
w,a,b = [int(x) for x in input().split()]
print(abs(b-w-(b-a+w))) if a+w <= b else print(0)

Buggy submission (verdict: Runtime Error):
a,b = input.split()
print('H') if a == b else print('D')
Problem p03796 (python)

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

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

Buggy submission (verdict: Runtime Error):
import math
n = gets.to_i
print(math.factorical(n) % (10**9 + 7))
Problem p03813 (python)

Fixed submission:
a = int(input())
print('ARC') if a>=1200 else print('ABC')

Buggy submission (verdict: Runtime Error):
a = input()
print(len(a[a.index('A'):a.rindex('Z')+1]))
Problem p03814 (python)

Fixed submission:
a = input()
print(len(a[a.index('A'):a.rindex('Z')+1]))

Buggy submission (verdict: Runtime Error):
a = input()
b = a[a.index('A'):a.rindex('z')+1]
Problem p03826 (python)

Fixed submission:
a,b,c,d = [int(x) for x in input().split()]
print(a*b) if (a*b) >= (c*d) else print(c*d)

Buggy submission (verdict: Runtime Error):
input()
tmp = x = 0
for a in input():
  x += int(a.replace('I','1').replace('D','-1'))
  if tmp < x:
    tmp = x

print(max([0,tmp]))

Buggy submission (verdict: Runtime Error):
input()
tmp = x = 0
for a in input():
  x += int(a.replace('I','1').replace('D','-1'))
  if tmp < x:
    tmp = x

print(max([,tmp]))

Buggy submission (verdict: Runtime Error):
a,b,c,d = [int(x) for x in input().sprit()]
print(a*b) if (a*b) >= (c*d) else print(c*d)

Buggy submission (verdict: Runtime Error):
a,b,c,d = [int(x) for x in input.sprit()]
print(a*b) if (a*b) >= (c*d) else print(c*d)

Buggy submission (verdict: Runtime Error):
a,b,c,d = [int(x) for x in input.split()]
print(a*b) if (a*b) >= (c*d) else print(c*d)
Problem p03844 (python)

Fixed submission:
a,o,b = input().split()
print(int(a) + int(o+b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
m = int(input())
for _ in range(m):
  t = a
  b,c = [int(x) for x in input().split()]
  t[b-1] = c
  print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
m = int(input())
for _ in range(m):
  b,c = [int(x) for x in input.split()]
  a[b-1] = c
  print(sum(a))

Buggy submission (verdict: Runtime Error):
a,o,b = input().split()
print(a + int(o+b))
Problem p03845 (python)

Fixed submission:
from copy import deepcopy
n = int(input())
a = [int(x) for x in input().split()]
m = int(input())
for _ in range(m):
  t = deepcopy(a)
  b,c = [int(x) for x in input().split()]
  t[b-1] = c
  print(sum(t))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [input() for _ in range(n)]
m = int(input())
for _ in range(m):
  b,c = [int(x) for x in input.split()]
  a[b-1] = c
  print(sum(a))

Buggy submission (verdict: Runtime Error):
n = input()
a = [input() for _ in range(n)]
m = input()
for _ in range(m):
  b,c = [int(x) for x in input.split()]
  a[b-1] = c
  print(sum(a))
Problem p03151 (python)

Fixed submission:
N=input()
A=map(int,raw_input().split())
B=map(int,raw_input().split())
need=0
Ans=0

for a,b in zip(A,B):
    if b>a:
        need+=b-a
        Ans+=1
        
index=0

Gap=[a-b for a,b in zip(A,B)]
Gap.sort(reverse=True)

while need>0:
    if Ans+index>=N:
        break
    need-=Gap[index]
    index+=1
    
if need<=0:
    print Ans+index
else:
    print "-1"

Buggy submission (verdict: Runtime Error):
for a,b in zip(A,B):
    if b>a:
        need+=b-a
        Ans+=1

Gap=[a-b for a,b in zip(A,B)]
Gap.sort(reverse=True)
index=0
while need>0 and Ans+index<=N:
    need-=Gap[index]
    index+=1
    
if Ans+index<=N:
    print Ans+index
else:
    print "-1"
Problem p03194 (python)

Fixed submission:
import collections
N,P=map(int,raw_input().split())

Soin=[]
for i in range(2,int(P**0.5)+1):
    while P%i==0:
        P=P/i
        Soin.append(i)
if P!=1:
    Soin.append(P)

Soin_s=collections.Counter(Soin)

Ans=1
for s in Soin_s:
    if Soin_s[s]>=N:
        Ans=Ans*(s**(Soin_s[s]/N))
print Ans

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

import sympy

Soin=sympy.factorint(P)
Soin_s=sorted(Soin.items(), key=lambda x: x[1])
Ans=1
for s_s in Soin_s:
    if s_s[1]>=N:
        Ans=Ans*(s_s[0]**(s_s[1]/N))
print Ans
Problem p03213 (python)

Fixed submission:
N=input()
Ans=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 8, 8, 11, 11, 11, 11, 14, 14, 32, 32, 35, 35, 35, 35, 42, 42, 42, 42, 49, 49, 49, 49, 49, 49, 75, 75, 86, 86, 86, 86, 86, 86, 123, 123, 131, 131, 131, 131, 148, 148, 153, 153, 170, 170, 170, 170, 170, 170, 227, 227, 227, 227, 227, 227, 250, 250, 323, 323, 324, 324, 324, 324, 354, 354, 354, 354, 384, 384, 384, 384, 384, 391, 491, 491, 529, 529, 529, 529, 529, 529, 543]

print Ans[N]

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

import sympy
import math
import numpy as np
a=sympy.factorint(math.factorial(N))

a=np.array([a for a in a.values()])

print len(np.where(a>=74)[0])\
        +len(np.where(a>=24)[0])*(len(np.where(a>=2)[0])-1)\
        +len(np.where(a>=14)[0])*(len(np.where(a>=4)[0])-1)\
        +(len(np.where(a>=4)[0])*(len(np.where(a>=4)[0])-1)*(len(np.where(a>=2)[0])-2))/2
Problem p03220 (python)

Fixed submission:
N=input()
T,A=map(int,raw_input().split())
H=map(int,raw_input().split())

temp=[[abs(T-H[i]*0.006-A),i+1] for i in range(N)]
temp.sort()
print temp[0][1]

Buggy submission (verdict: Runtime Error):
N=input()
T,A=map(int,raw_input().split())
H=map(int,raw_input().split())

temp=[[abs(T-H[i]*0.006-A),i+1] for i in range(N)]
temp.sort()
print temp[0][2]
Problem p03241 (python)

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

upper=M/N
def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
def divisorize(fct):
    b, e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]
def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

fct = factorize(M)
if fct==[]:
    print 1
    exit()

Ans=1
for div in divisorize(fct):
    if num(div)<=upper:
        Ans=max(Ans,num(div))
   
print Ans

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

upper=M/N
def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
def divisorize(fct):
    b, e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]
def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

fct = factorize(M)

Ans=1
for div in divisorize(fct):
    if num(div)<=upper:
        Ans=max(Ans,num(div))
   
print Ans

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

upper=M/N
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]
def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
# 素因数
fct = factorize(M)
# 約数
Ans=1
for div in divisorize(fct):
    if num(div)<=upper:
        Ans=max(Ans,num(div))
   
print Ans

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

upper=M/N

for i in range(upper):
    if M%(upper-i)==0:            
        print upper-i
        exit()
Problem p03105 (python)

Fixed submission:
import sys
 
l = []
for line in sys.stdin:
  l.append([int(i) for i in line.split()])
 
a, b, c = l[0]
if b >= a * c:
  print(c)
else:
  print(b//a)

Buggy submission (verdict: Runtime Error):
import sys

l = []
for line in sys.stdin:
  l.append([int(i) for i in line.split()])

a, b, c = l
if b >= a * c:
  print(c)
else:
  print(b//a)
Problem p03110 (python)

Fixed submission:
import sys
 
v = []
for line in sys.stdin:
    v.append([i for i in line.split()])
 
m = 0
for a, b in v[1:]:
  a = float(a)
  if b == "JPY":
    m += a
  else:
    m += 380000.0 * a
print(m)

Buggy submission (verdict: Runtime Error):
import sys

v = []
for line in sys.stdin:
    v = [i for i in line.split()]

m = 0
for a, b in v[1:]:
  a = float(a)
  if b == "JPY":
    m += a
  else:
    m += 380000.0 * a
print(m)
Problem p03125 (python)

Fixed submission:
import sys

v = []
for line in sys.stdin:
  v = [int(l) for l in line.split()]

if v[1] % v[0] == 0:
  print(v[0] + v[1])
else:
  print(v[1] - v[0])

Buggy submission (verdict: Runtime Error):
import sys

v = []
for line in sys.stdin:
  v.append(int(line))

if v[1] % v[0] == 0:
  print(v[1] + v[0])
else:
  print(v[0] - v[1])
Problem p03126 (python)

Fixed submission:
import sys

v = []
for line in sys.stdin:
    v.append([int(l) for l in line.split()])

n = v[0][0]
m = v[0][1]

a = None
for line in v[1:]:
  if a == None:
    a = line[1:]
  else:
    c = []
    for b in a:
      if b in line[1:]:
        c.append(b)
    a = c
print(len(a))

Buggy submission (verdict: Runtime Error):
import sys

v = []
for line in sys.stdin:
  v.append([int(l) for l in line.split()])

n, m = v[0]
min_k = -1
min_idx = -1
for idx, line in enumerate(v[1:]):
  if min_k == -1 or min_k > line[0]:
    min_k = line[0]
    min_idx = idx + 1

count = 0
min_v = line[min_idx, 1:]
for min_v_v in min_v:
	if n == sum(min_v_v in v[1:,1:]):
      count+=1
print(count)
Problem p03231 (python)

Fixed submission:
from fractions import *

def lcm(a,b): 
    return int(abs(a * b) / gcd(a,b) if a and b else 0)

def getDivisors(a,b):
    divisors = []
    for i in range(2,min(a,b)+1):
        if a % i == 0 and b % i == 0:
            divisors.append(i)
    return divisors

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

if a[0] != b[0]:
    print(-1)
elif gcd(N,M) == 1:
    print(lcm(N,M))
elif N != M:
    divisors = getDivisors(N,M)

    for i in divisors:
        k = N//i
        l = M//i
        while k < N and l < M:
            if a[k] != b[l]:
                print(-1)
                quit()
            k += N//i
            l += M//i
    print(lcm(N,M))
else:
    if a == b: print(N)
    else: print(-1)

Buggy submission (verdict: Runtime Error):
from fractions import *

def lcm(a,b): 
    return int(abs(a * b) / gcd(a,b) if a and b else 0)

def getDivisors(a,b):
    divisors = []
    for i in range(2,min(a,b)+1):
        if a % i == 0 and b % i == 0:
            divisors.append(i)
    return divisors

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

if a[0] != b[0]:
    print(-1)
elif gcd(N,M) == 1:
    print(lcm(N,M))
elif N != M:
    divisors = getDivisors(N,M)

    for i in divisors:
        k = N//i
        l = M//i
        while k <= N and l <= M:
            if a[k] != b[l]:
                print(-1)
                quit()
            k *= 2
            l *= 2
    print(lcm(N,M))
else:
    if a == b: print(N)
    else: print(-1)

Buggy submission (verdict: Runtime Error):
from fractions import *

def lcm(a,b): 
    return int(abs(a * b) / gcd(a,b) if a and b else 0)

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

if N % M != 0 and M % N != 0:
    print(lcm(N,M))
elif N % M == 0:
    # a is the larger string
    step = N // M
    for i in range(M):
        if b[i] != a[i + step]:
            print(-1)
            quit()
    print(N)
else:
    # b is the larger string
    step = M // N
    for i in range(N):
        if a[i] != b[i + step]:
            print(-1)
            quit()
    print(M)
Problem p03240 (python)

Fixed submission:
N = int(input())

X = []
Y = []
h = []
for i in range(N):
    a,b,c = map(int,input().split())

    if c > 0:
        p = i
    X.append(a)
    Y.append(b)
    h.append(c)

for Cx in range(101):
    for Cy in range(101):
        works = True
        H = h[p] + abs(X[p] - Cx) + abs(Y[p] - Cy)
        for i in range(N):
            if h[i] != max(H - abs(X[i] - Cx) - abs(Y[i] - Cy), 0):
                works = False
                break
        
        if works:
            print(Cx,Cy,H)
            quit()

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

X = []
Y = []
h = []
for i in range(N):
    a,b,c = map(int,input().split())

    X.append(a)
    Y.append(b)
    h.append(c)

for Cx in range(101):
    p = False
    for Cy in range(101):
        w = True
        previous = None
        for i in range(0,N):
            H = h[i] + abs(X[i] - Cx) + abs(Y[i] - Cy)
            if H - abs(X[i] - Cx) - abs(Y[i] - Cy) >= 0:
                if not previous:
                    previous = H
                elif H != previous or H < 1:
                    w = False
                    break
        
        if w:
            answer = [Cx,Cy,H]
            p = True
            break

    if p:
        break

print(answer[0],answer[1],answer[2])
Problem p03473 (python)

Fixed submission:
print(48-int(input()))

Buggy submission (verdict: Runtime Error):
print(abs(int(input)-48))
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline
print = sys.stdout.write

n,k = map(int,input().split())

freq = {}
a = [int(i) for i in input().split()]

for i in a:
    if i not in freq:
        freq[i] = 1
    else:
        freq[i] += 1

total = 0
while len(freq.keys()) > k:
    mn = (0,2000001)
    for i in freq.keys():
        if freq[i] < mn[1]:
            mn = (i,freq[i])
    total += mn[1]
    del freq[mn[0]]
print(str(total))
Problem p03569 (python)

Fixed submission:
use = input()

total = 0
p = 0
p1 = len(use) - 1
while p < p1:
	if use[p] == use[p1]:
		p += 1
		p1 -= 1
	elif use[p] == "x":
		p += 1
		total += 1
	elif use[p1] == "x":
		p1 -= 1
		total += 1
	else:
		total = -1
		break
print(total)

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

total = 0
p = 0
p1 = len(use) - 1
while p != p1:
	if use[p] == use[p1]:
		p += 1
		p1 -= 1
	elif use[p] == "x":
		p += 1
		total += 1
	elif use[p1] == "x":
		p1 -= 1
		total += 1
	else:
		total = -1
		break
print(total)
Problem p03645 (python)

Fixed submission:
d = {}

def bfs(graph, start, goal): 
#These variables define the visited set (to make sure that the program doesn’t go through the same nodes twice) a queue to make sure that the node seen next is visted first. 
 
    visited, queue = set(), [start] 
    pathsTo = {} 
    pathsTo[start] = [start] 
    index = 0
    lenqueue = 1
# Ensuring that the queue is not empty at any point in time. 
    while index < lenqueue: 
# Getting the next node and getting rid of the node in the front of the queue. 
        vertex = queue[index] 
        if vertex not in visited: 
            visited.add(vertex) 
 
 
            # Going through each element in the adjacency list and making sure that it hasn’t been visited, and that it is not in the same path. 
            for newVertex in (graph[vertex]): 
                if newVertex not in visited: 
                    if newVertex not in pathsTo: 
                        pathsTo[newVertex] = list() 
 
                    for path in pathsTo[vertex]: 
                        pathsTo[newVertex].append(str(path)+"->"+str(newVertex)) 
                    queue.append(newVertex)
                    lenqueue += 1
        index += 1
    # Return the paths toward the goal.
    if goal not in pathsTo.keys():
        return ["8384793->8->4->7-> 9 8 23748"]
    return pathsTo[goal] 

N, M = map(int,input().split())
for i in range(M):
    a,b = map(int,input().split())
    if a not in d.keys():
        d[a] = [b]
    else:
        d[a].append(b)

    if b not in d.keys():
        d[b] = [a]
    else:
        d[b].append(a)

dist = len(bfs(d,1,N)[0].split("->")) - 1
if dist <= 2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

if use < 4:
    print(1)
elif use < 8:
    print(4)
elif use < 16:
    print(8)
elif use < 32:
    print(16)
elif use < 64:
    print(32)
elif use > 63:
    print(64)

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

if use < 4:
    print(1)
elif use < 8:
    print(4)
elif use < 16:
    print(8)
elif use < 32:
    print(16)
elif use < 64:
    print(32)
else:
    print(64)
Problem p03943 (python)

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

candy = map(int, raw_input().split())
mx = max(candy)
total = 0
for n in candy:
    if n != mx:
        total += n
if total == mx:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
candy = map(int, raw_input().split())
mx = max(candy)
total = 0
for n in candy:
    if n != mx:
        total += n
if total == mx:
    print("Yes")
else:
    print("No")
Problem p03487 (python)

Fixed submission:
import numpy as np

# input
N = int(input().split()[0])
sequence = np.array(list( map(int, input().split()) ))

# a_N>N must be removed
remove = np.sum(sequence>N)
sequence = sequence[sequence<=N]

index = np.unique(sequence)

for idx in index:

    n_idx = np.sum(sequence==idx)
    if n_idx < idx:
        remove += n_idx
    else:
        remove += (n_idx-idx)

print(remove)

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

# input
N = int(input().split()[0])
sequence = np.array(list( map(int, input().split()) ))

# a_N>N must be removed
remove = np.sum(sequence>N)
sequence = sequence[sequence<=N]

index = np.unique(sequence)

for idx in index:

    n_idx = np.sum(sequence==idx)
    if n_idx < idx:
        remove += n_idx
    else:
        remove += (n_idx-idx)

print(remove)

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

# input
N = int(input().split())
sequence = list( map(int, input().split()) )

# a_N>N must be removed
remove = np.sum(sequence>N)
sequence = sequence[sequence<=N]

index = np.unique(sequence)

for idx in index(sequence):

    n_idx = np.sum(sequence==idx)
    if n_idx < idx:
        remove += n_idx
    else:
        remove += (n_idx-idx)

print(remove)
Problem p03109 (python)

Fixed submission:
s = input()
s = int(s.replace("/", ""))
if s <= 20190430 :
    print("Heisei")
else :
    print("TBD")

Buggy submission (verdict: Runtime Error):
s = input()
s = s.replace("/", "")
if s <= 20190430 :
    print("Heisei")
else :
    print("TBD")
Problem p03110 (python)

Fixed submission:
n = int(input())
money = []
for _ in range(n) :
    xi, yi = input().split()
    xi = float(xi)
    if yi == "JPY" :
        xi = xi
    elif yi == "BTC" :
        xi = xi * 380000.0
    money += [xi]
print(sum(money))

Buggy submission (verdict: Runtime Error):
n = int(input())
money = []
for _ in range(n) :
    xi, yi = input().split()
    xi = int(xi)
    if yi == "JPY" :
        xi = xi
    elif yi == "BTC" :
        xi = xi * 380000.0
    money += [xi]
print(sum(money))
Problem p03308 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a)- min(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for _ in range(n) :
    a += [int(input())]
print(max(a)- min(a))
Problem p03316 (python)

Fixed submission:
n = input()
sn = sum([int(i) for i in list(n)])
if int(n) % sn == 0 :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
sn = sum([int(i) for i in list(n)])
if n % sn == 0 :
    print("Yes")
else :
    print("No")
Problem p03474 (python)

Fixed submission:
a, b = map(int, input().split())
s = input()
if s[a] == "-" :
    try :
        if (isinstance(int(s[:a]),int)) and (isinstance(int(s[a+1:]),int)) :
            print("Yes")
        else :
            print("No")
    except :
        print("No")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
if s[a] == "-" :
    if int(s[:a]) is int and int(s[a+1:]) is int :
        print("Yes")
    else :
        print("No")
else :
    print("No")
Problem p03658 (python)

Fixed submission:
n, k = map(int, input().split())
l = sorted(list(map(int, input().split())),reverse=True)
print(sum(l[0:k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list(map(int, input().split())).sort(reverse=True)
print(sum(l[0:k]))
Problem p03694 (python)

Fixed submission:
n = input()
a = list(map(int, input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n
a = list(map(int, input().split()))
print(max(a)-min(a))
Problem p03711 (python)

Fixed submission:
x, y = map(int,input().split())
group1 = {1,3,5,7,8,10,12}
group2 = {4,6,9,11}
group3 = {2}
if (x in group1) and (y in group1) :
    print("Yes")
elif (x in group2) and (y in group2) :
    print("Yes")
elif (x in group3) and (y in group3) :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x、y = map(input().split())
group1 = (1,3,5,7,8,10,12)
group2 = (4,6,9,11)
group3 = (2)
if (x in group1) and (y in group1) :
    print("Yes")
if (x in group2) and (y in group2) :
    print("Yes")
if (x in group3) and (y in group3) :
    print("Yes")
else:
    print("No")