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

Fixed submission:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
bc = [list(map(int,input().split())) for i in range(m)]
cb = [[-c,b] for b,c in bc]
from heapq import heappush, heappop, heapify
ret = 0
heapify(a)
heapify(cb)
flg = True
while flg and len(cb)>0:
    c,j = heappop(cb)
    for _ in range(j):
        if len(a)==0:
            flg=False
            break
        min_a = heappop(a)
        if min_a < -c:
            ret+=(-c)
        else:
            ret+=min_a
            flg=False
            break
ret+=sum(a)
print(ret)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
bc = [list(map(int,input().split())) for i in range(m)]
cb = [[-c,b] for b,c in bc]
from heapq import heappush, heappop, heapify
ret = 0
heapify(a)
heapify(cb)
flg = True
while flg and len(cb)>0:
    c,j = heappop(cb)
    for _ in range(j):
        min_a = heappop(a)
        if min_a < -c:
            ret+=(-c)
        else:
            ret+=min_a
            flg=False
            break
ret+=sum(a)
print(ret)
Problem p03107 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a = input()
len_a = len(a)
sum_a = sum(list(map(int,list(a))))
ret = min(sum_a,len_a-sum_a) * 2
print(ret)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from copy import copy
a = list(map(int,input()))
cur_min = 100001
def remove_max(cubes):
    global cur_min
    for i in range(len(cubes)-1):
        if cubes[i] != cubes[i+1]:
            z = copy(cubes)
            z.pop(i)
            z.pop(i)
            if len(z) == 0:
                cur_min=0
            if len(z) <= cur_min:
                cur_min = len(z)
                remove_max(z)
remove_max(a)
if cur_min==100001:
    print(0)
else:
    print(len(a) - cur_min)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from copy import copy
a = list(input())
cur_min = 100001
def remove_max(cubes):
    global cur_min
    for i in range(len(cubes)-1):
        if cubes[i] != cubes[i+1]:
            z = copy(cubes)
            z.pop(i)
            z.pop(i)
            if len(z) == 0:
                cur_min=0
            if len(z) <= cur_min:
                cur_min = len(z)
                remove_max(z)
remove_max(a)
if cur_min==100001:
    print(0)
else:
    print(len(a) - cur_min)
Problem p03208 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N,K = map(int,input().split())
c = [int(input()) for i in range(N)]
c.sort()
output = c[K-1] - c[0]
for i in range(N-K):
    if output > c[K+i] - c[i+1]:output = c[K+i] - c[i+1]
print(output)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N,K = map(int,input().split())
c = [int(input()) for i in range(N)]
c.sort()
output = c[K-1] - c[0]
for i in range(N-K):
    output = c[K+i] - c[i+1] if output > c[K+i] - c[i+1]
print(output)
Problem p03221 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
d = [[i,tuple(map(int,input().split()))] for i,_ in enumerate(range(m))]
#print(d)

d.sort(key=lambda x:x[1][1])
p_cnt = [0] * (n+1)
ret_tuples = [0] * m #(市id,認識番号) のtupleのリスト

for i,v in enumerate(d):
    p = v[1][0]
    x = p_cnt[p]+1
    p_cnt[p]+=1
    ret_tuples[i] = (v[0],"{:0=6}{:0=6}".format(p,x))

ret_tuples.sort(key=lambda x:x[0])
for i in ret_tuples:
    print(i[1])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input().split()[1])
c = [int(input().split()[0]) for i in range(a)]
import collections
c = collections.Counter(c)
for k,v in sorted(c.items()):
    for i in range(v):
        j = i+1
        print(f'{k:08}{j:08}')
Problem p02629 (python)

Fixed submission:
def main():
    suu="abcdefghijklmnopqrstuvwxyz"#26
    n=int(input())
    puts=""
    if n<27:#その数より小さい
        print(suu[n-1])
        return
    while True:
        temp=n%26
        n//=26
        puts=suu[temp-1]+puts
        if temp==0:#補正
            n-=1
        if n<27:
            puts=suu[n-1]+puts
            break
    print(puts)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    suu="abcdefghijklmnopqrstuvwxyz"#26
    n=int(input())
    puts=""
    if n<27:#その数より小さい
        print(suu[n-1])
        return
    while True:
        temp=n%26
        puts=suu[temp-1]+puts
        n/=26
        if temp==0:#補正
            n-=1
        if n<27:
            puts=suu[n-1]+puts
            break
    print(puts)
if __name__ == "__main__":
    main()
Problem p02699 (python)

Fixed submission:
s,w=map(int,input().split())
print(("un"if w>=s else "")+"safe")

Buggy submission (verdict: Runtime Error):
s=input();c=0
for i in range(len(s)):
    for j in range(1,len(s)+1):
        if s[i:j]:
            if int(s[i:j])%2019==0:
                c+=1
print(c)
Problem p03775 (python)

Fixed submission:
from math import sqrt
def F(A,B):
    A=len(str(A))
    B=len(str(B))-2
    return A if A>B else B
n=int(input())
o=[]
for a in range(1,int(sqrt(n))+1):
    b=n/a
    if b.is_integer():
        o.append(F(a,b))
print(o[-1])

Buggy submission (verdict: Runtime Error):
def F(a,b):
    a=len(str(a))
    b=len(str(b))-2#float型のため
    return a if a>b else b
n=int(input())
o=[]
k=100000000
c=0
m=10000000000
for i in range(1,n):
    if c>0:
        c-=1
        continue
    if i>=n:
        break
    s=n/i
    if s.is_integer():
        k=F(i,s)
        o.append(k)
        if k>m:
            break
        m=k
        i=int("1"+"0"*len(str(i)))-i#iを次の位にする
print(min(o))
Problem p02577 (python)

Fixed submission:
def main():
    n = input()

    s = 0

    while n:
        s += int(n[-1])
        n = n[:-1]
    
    if s%9==0:
        print('Yes')
    else:
        print('No')
        
if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    s = 0
    while n != 0:
        s += n%10
        n =int(n/10)
    if s%9==0:
        print('Yes')
    else:
        print('No')
        
if __name__=='__main__':
    main()
Problem p02881 (python)

Fixed submission:
import math

n = int(input())

for i in range(int(math.sqrt(n)), 0, -1):
  if n % i == 0:
    print(int(i + n / i - 2))
    break

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

list=[]

for i in range(1,int((n+1)/2)):
    a=n%i
    if(len(list) == 1 and i>n/i):
        ans=(list[-1][0]-1)+(list[-1][1]-1)    
        break
    if a == 0:
        if(i<n/i):
            list.append([i,int(n/i)])
        else:
            list.append([int(n/i),i])
            if len(list) == 1:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
                break
            if list[-1]==list[-2]:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
                break
print(ans)

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

list=[]

for i in range(1,int((n+1)/2)):
    a=n%i
    if(len(list) == 1 and i>n/i):
        ans=(list[-1][0]-1)+(list[-1][1]-1)    
        break
    if a == 0:
        if(i<n/i):
            list.append([i,int(n/i)])
        else:
            list.append([int(n/i),i])
            if len(list) == 1:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
                break
            if list[-1]==list[-2]:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
                break
print(ans)

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

list=[]

for i in range(1,int(n+1/2)):
    a=n%i
    if a == 0:
        if(i<n/i):
            list.append([i,int(n/i)])
        else:
            list.append([int(n/i),i])
            if len(list) == 1:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
                break
            if list[-1]==list[-2]:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
print(ans)

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

list=[]

for i in range(1,12):
    a=n%i
    if a == 0:
        if(i<n/i):
            list.append([i,int(n/i)])
        else:
            list.append([int(n/i),i])

    if i>1 :
        if len(list) == 1:
            ans=(list[-1][0]-1)+(list[-1][1]-1)
            break
        if list[-1]==list[-2] or len(list)==1:
            ans=(list[-1][0]-1)+(list[-1][1]-1)
            break
print(ans)
Problem p02880 (python)

Fixed submission:
a = int (input())  

if a>81:
  print("No")
else:
  c = 1
  for i in range(9):
    b = a/(9-i)
    
    if b.is_integer()==True and b<10:
      c = 0
    else:
      c = c*1
  if c==0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = int (input())
if a>81:
  print("No")
else:
  c = 1
  for i in range(7):
    b = a/(9-i)
    
    if b.is_integer()==True and b<10:
      c = 0
    else:
      c = c*1
if c==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = int (input())
if a>81:
  print("No")
else:
  c = 1
  for i in range(7):
    b = a/(9-i)
    print(b)
    
    if b.is_integer()==True and b<10:
      c = 0
      print(c)
    else:
      c = c*1
      print(c)
if c==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = int (input())
if a>81:
  print("No")
else:
  c = 1
  for i in range(7):
    b = a/(9-i)
    print(b)
    
    if b.is_integer()==True and b<10:
      c = 0
      print(c)
    else:
      c = c*1
      print(c)
if c==0:
  print("Yes")
else:
  print("No")
Problem p02659 (python)

Fixed submission:
a_s, b_s = input().split()

b_s = b_s.replace(".", "")

s = str(int(a_s) * int(b_s))
if len(s) > 2:
    print(str(int(a_s) * int(b_s))[:-2])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a_s, b_s = input().split()

a = int(a_s)
b = int(float(b_s) * 100)

print(int(str(a*b)[:-2]))

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

print(int(a * b))
Problem p02629 (python)

Fixed submission:
table = list("abcdefghijklmnopqrstuvwxyz")
N = int(input())

ans = []
while True:
    ans.append(N%26)
    if N%26 == 0:
        N -= 1
    if  N//26 == 0:
        break
    N//=26
for x in reversed(ans):
    print(table[x-1],end='')

print()

Buggy submission (verdict: Runtime Error):
table = [0] + [chr(i) for i in range(97, 97+26)]

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = table[X_dumy%n]+out
        X_dumy = int(X_dumy/n)
    return out

print(Base_10_to_n(int(input()),26))
Problem p03805 (python)

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

path = [[] for i in range(N)]

for _ in range(M):
	a,b = map(int,input().split())
	path[a-1].append(b-1)
	path[b-1].append(a-1)
vis = [0 for i in range(N)]
cnt = 0

def dfs(now,depth):
	global cnt
	if depth == N: cnt+=1
	for new in path[now]:
		if vis[new] == 0:
			vis[new] = 1
			dfs(new,depth+1)
			vis[new] = 0

vis[0] = 1
dfs(0,1)
print(cnt)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input(),aplit())

path = [[] for i in range(N)]

for _ in range(M):
	a,b = map(int,input(),split())
	path[a-1],append(b-1)
    path[b-1],append(a-1)
vis = [0 for i in range(N)]
cnt = 0

def dfs(now,path):
	global cnt
  	if depth == N: cnt+=1
	for new in path[now]:
    	if vis[new] == 0:
			vis[new] = 1
        	dfs(new,depth+1)
          	vis[new] = 0

vis[0] = 1
dfs(0,1)
print(cnt)
Problem p03295 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
n, m = map(int, input().split())
# demands = [tuple(map(int, input().split())) for i in range(m)]
demands = [
    tuple(map(int,
              line.strip().split())) for line in sys.stdin.readlines()
]
demands.sort(key=lambda x: x[1])

compressed = []
while demands:
    a, b = demands.pop()

    for i, (ai, bi) in enumerate(compressed):
        if b <= ai or bi <= a:
            continue

        else:
            compressed[i] = [max(a, ai), min(b, bi)]
            break

    else:
        compressed.append([a, b])

print(len(compressed))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
n, m = map(int, input().split())
demands = (tuple(map(int,
                     line.strip().split())) for line in sys.stdin.readlines())
demands.sort(key=lambda demand: demand[1])

bridge = -1
cnt = 0
for ai, bi in demands:

    if ai <= bridge:
        continue

    else:
        bridge = bi - 1
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
n, m = map(int, input().split())
demands = [
    tuple(map(int,
              line.strip().split())) for line in sys.stdin.readlines()
]
demands.sort(key=lambda a, b: b)

compressed = []
while demands:
    a, b = demands.pop()

    for i, (ai, bi) in enumerate(compressed):
        if b <= ai or bi <= a:
            continue

        else:
            compressed[i] = [max(a, ai), min(b, bi)]
            break

    else:
        compressed.append([a, b])

print(len(compressed))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
n, m = map(int, input().split())
demands = [
    tuple(map(int,
              line.strip().split())) for line in sys.stdin.readlines()
]

compressed = []
while demands:
    a, b = demands.pop()

    flag = False
    for i, (ai, bi) in enumerate(compressed):
        if b <= ai or bi <= a:
            continue

        else:
            compressed = [max(a, ai), min(b, bi)]
            break

    else:
        compressed.append([a, b])

print(len(compressed))
Problem p02682 (python)

Fixed submission:
A, B, C, K = map(int, input().split())
out = min(A, K)
if A+B < K:
  out -= (K-A-B)
print(out)

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

abc = [1]*A + [0]*B + [-1]*C
print(sum(abc[:K]))
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
A = set()
for _ in range(K):
  d = input()
  A = A.union(set(map(int, input().split())))
print(N - len(A))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = []
for i in range(K):
  d = input()
  A += list(map(int, input()))
print(N - len(set(A)))
Problem p02753 (python)

Fixed submission:
A = False
B = False
s=input()
for char in s:
    if char == "A":
        A = True
    if char == "B":
        B = True
if(A and B):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, p = map(int,input().split())
D = input()
count = [0] * p
out = 0

if 10 % p == 0:
    for i in range(n):
        if int(D[i]) % p == 0:
            out += i + 1
else:
    ten = 1
    count[0] = 1
    for i in range(n):
        mod = (mod + int(D[n-i-1]) * ten) % p
        count[mod] += 1
        ten *= 10
    for c in count:
        out += (c * (c - 1)) // 2
print(out)

Buggy submission (verdict: Runtime Error):
n, p = map(int,input().split())
s = input()
count = 0
for i in range(1, n + 1):
    for j in range(n - i + 1):
        num = 0
        for k in range(i):
            num += int(s[j + k]) * (10 ** (i - k - 1))
        if(num % p == 0):
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
n = int(input())
print(n)
for i in range(n):
    li = input().split()
    if(li[0] == '1'):
        s = s[::-1]
    else:
        if(li[1] == '1'):
            s = li[2] + s
        else:
            s = s + li[2]
print(s)

Buggy submission (verdict: Runtime Error):
li = list(map(int,input().split()))
a = 0
b = 0
out = 0
isA = True
for i in range(li[0]):
    if(isA):
        a += 1
        out += 1
        if(a >= li[1]):
            isA = False
            a = 0
    else:
        b += 1
        if(b >= li[2]):
            isA = True
            b = 0
print(out)
Problem p02763 (python)

Fixed submission:
import bisect

N = int(input())
S = list(str(input()))

def ordN(x):
  return ord(x) - ord('a')

li = [[] for _ in range(26)]
for i,s in enumerate(S):
  li[ordN(s)].append(i)

for i in range(int(input())):
  Q1, Q2, Q3 = input().split()
  if Q1 == "1":
    Q2 = int(Q2) - 1
    if S[Q2] != Q3:
      I = bisect.bisect_left(li[ordN(S[Q2])], Q2)
      li[ordN(S[Q2])].pop(I)
      bisect.insort(li[ordN(Q3)], Q2)
      S[Q2] = Q3
  else:
    Q2, Q3 = int(Q2)-1, int(Q3)-1
    count = 0
    for j in range(26):
      I = bisect.bisect_left(li[j], Q2)
      if I < len(li[j]) and li[j][I] <= Q3:
        count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
S = list(str(input()))

def ordN(x):
  return ord(x) - ord('a')

li = [[] for _ in range(26)]
for i,s in enumerate(S):
  li[ordN(s)].append(i)

for i in range(int(input())):
  Q1, Q2, Q3 = input().split()
  if Q1 == "1":
    Q2 = int(Q2) - 1
    if S[Q2] != Q3:
      I = bisect.bisect(li[ordN(S[Q2])], Q2)
      li[ordN(S[Q2])].pop(I)
      bisect.insort(li[ordN(Q3)], Q2)
      S[Q2] = Q3
  else:
    Q2, Q3 = int(Q2)-1, int(Q3)-1
    count = 0
    for j in range(26):
      I = bisect.bisect_left(li[j], Q2)
      if I < len(li[j]) and li[j][I] <= Q3:
        count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
S = list(str(input()))

def ordN(x):
  return ord(x) - ord('a')

li = [[] for _ in range(26)]
for i,s in enumerate(S):
  li[ordN(s)].append(i)

for i in range(int(input())):
  Q1, Q2, Q3 = input().split()
  if Q1 == "1":
    Q2 = int(Q2) - 1
    if S[Q2] != Q3:
      I = bisect.bisect(li[ordN(S[Q2])])
      li[ordN(S[Q2])].pop(I)
      bisect.insort(li[ordN(Q3)], Q2)
      S[Q2] = Q3
  else:
    Q2, Q3 = int(Q2)-1, int(Q3)-1
    count = 0
    for j in range(26):
      I = bisect.bisect_left(li[j], Q2)
      if I < len(li[j]) and li[j][I] <= Q3:
        count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
S = list(input())
Q = int(input())
for _ in range(Q):
    Q1, Q2, Q3 = map(int, input().split())
    if Q1 == '1':
        S[int(Q2)-1] = ord(Q3)
    else:
        print(len(collections.Counter(S[int(Q2)-1: int(Q3)])))
Problem p02835 (python)

Fixed submission:
a = list(map(int,input().split()))
s = sum(a)
if s >=22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
s = sum(a)
if s >=22:
  print('bust')
else:
  print('win')
Problem p02688 (python)

Fixed submission:
import numpy as np

N, K = map(int, input().split())
A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp
hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]-1] = 0
print(int(np.sum(hito)))

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

N, K = map(int, input().split())
A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp
hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]] = 0
print(int(np.sum(hito)))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())

A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp

hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]] = 0
print(int(np.sum(hito)))
Problem p02689 (python)

Fixed submission:
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(N)
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        yoi[B-1] = 0
    elif H[B-1] > H[A-1]:
        yoi[A-1] = 0
    elif H[A-1]==H[B-1]:
        yoi[A-1] = 0
        yoi[B-1] = 0
print(int(np.sum(yoi)))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(M)
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        yoi[B-1] = 0
    elif H[B-1] > H[A-1]:
        yoi[A-1] = 0
    elif H[A-1]==H[B-1]:
        yoi[A-1] = 0
        yoi[B-1] = 0
print(int(np.sum(yoi)))
Problem p02831 (python)

Fixed submission:
from fractions import gcd
A, B = map(int, input().split())
print(A*B//gcd(A, B))

Buggy submission (verdict: Runtime Error):
from math import gcd
A, B = map(int, input().split())
print(gcd(A, B))
Problem p03186 (python)

Fixed submission:
a, b, c = (int(i) for i in input().split())
if a + b + 1 >= c:
  result = b + c
else:
  result = a + 2 * b + 1
print(result)

Buggy submission (verdict: Runtime Error):
a, b, c = input(int(i) for i in input().split())
if a + b >= c:
  result = c + b
elif a + b < c:
  result = a + b + b
print(result)

Buggy submission (verdict: Runtime Error):
a, b, c = input(int(i) for i in input().split())
if a + b >= c:
  result = c + b
elif a + b < c:
  result = a + b
print(result)
Problem p02951 (python)

Fixed submission:
import glob

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\136'

# 絶対パス
ABS_PATH = TOP_PATH + '\\' + REL_PATH

#IS_TEST = 1


class Common:

    problem = []
    index = 0

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            return self.problem[self.index]
            self.index += 1
        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(ABS_PATH + '/*.txt'):
                self.initialize(path)
                self.resolve()
        except NameError:
            self.resolve()

class A(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]
        result = q[2] - q[0] +q[1]
        if result < 0:
            print('0')
        else:
            print(str(result))

solver = A()
solver.exec_resolve()

Buggy submission (verdict: Runtime Error):
	class Common:

    problem = []
    index = 0

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            return self.problem[self.index]
            self.index += 1
        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(ABS_PATH + '/*.txt'):
                self.initialize(path)
                self.resolve()
        except NameError:
            self.resolve()

class A(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]
        result = q[2] - q[0] +q[1]
        if result < 0:
            print('0')
        else:
            print(str(result))

solver = A()
solver.exec_resolve()
Problem p02627 (python)

Fixed submission:
N=input()
print("A" if str.isupper(N) else "a")

Buggy submission (verdict: Runtime Error):
Print("A" if str.isupper(input()) else "a")
Problem p02577 (python)

Fixed submission:
import numpy as np

N = str(input())
array = np.array(list(map(int, N)))

s = np.sum(array)
if s % 9 == 0:
  print('Yes')
else:
  print('No')

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

N = str(input())
array = np.array(list(map(int, s)))

s = np.sum(array)
if s % 9 == 0:
  print('Yes')
else:
  print('No')
Problem p03137 (python)

Fixed submission:
nm = input()
nm = nm.split()
n = int(nm[0])
m = int(nm[1])
nums = input()
nums = nums.split()
nums2 = []
for i in nums:
  nums2.append(int(i))
nums2.sort()
nums3 = []
i = 1
while i<len(nums2):
  nums3.append(nums2[i]-nums2[i-1])
  i+=1
nums3.sort()
nums3 = nums3[:len(nums3)-n+1]
if(n>=m):
  print(0)
else:
  print(sum(nums3))

Buggy submission (verdict: Runtime Error):
nm = input()
nm = nm.split()
n = int(nm[0])
m = int(nm[1])
nums = input()
nums = nums.split()
nums2 = []
for i in nums:
  nums2.append(int(i))
nums3 = []
i = 1
while i<len(nums2):
  nums3.append(nums2[i]-nums2[i-1])
  i+=1
for i in range(n-1):
  nums3.remove(max(nums3))
print(sum(nums3))
Problem p03207 (python)

Fixed submission:
n = int(input())
items = []
for i in range(n):
  items.append(int(input()))
result = str(sum(items)-max(items)/2)
print(result[:len(result)-2])

Buggy submission (verdict: Runtime Error):
n = int(input())
items = []
for i in range(n):
  items.append(int(input()))
result = sum(items)-max(items)/2
print(result[:len(result)-2])

Buggy submission (verdict: Runtime Error):
n = int(input())
items = []
for i in range(n):
  items.append(int(input())
print(sum(items)-max(items)/2)