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

Fixed submission:
a, b, c = map(int, input().split())
A = [a+b, b+c, c+a]
print(min(A))

Buggy submission (verdict: Runtime Error):
from bisect import bisect_right
from collections import defaultdict
h, w = map(int, input().split())
c = []
bf, bl = defaultdict(list), defaultdict(list)
ans = 0

for i in range(h):
    s = input()
    c.append(s)
    for j in range(w):
        if s[j] == '#':
            bl[i].append(j)
            bf[j].append(i)

for i in range(h):
    for j in range(w):
        tmp = 0
        if c[i][j] == '.':
            vert = bisect_right(bf[j], i)
            horz = bisect_right(bl[i], j)
            #print(bf[j], bl[i], i, j, vert, horz)
            if bf[j] == []:
                tmp += h-1
            elif i < bf[j][0] or bf[j][-1] < i:
                if i < bf[j][0]:
                    tmp += bf[j][0]-1
                else:
                    tmp += h-bf[j][-1]-2
            else:
                tmp += bf[j][vert]-bf[j][vert-1]-2
            if bl[i] == []:
                tmp += w-1
            elif j < bl[i][0] or bl[i][-1] < j:
                if j < bl[i][0]:
                    tmp += bl[i][0]-1
                else:
                    tmp += w-bl[i][-1]-2
            else:
                tmp += bl[i][horz]-bl[i][horz-1]-2
        ans = max(ans, tmp+1)
print(ans)
Problem p03038 (python)

Fixed submission:
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))
w = [tuple(map(int, input().split()))for _ in range(m)]
w.sort(key=lambda x: x[1], reverse=True)
ans = 0
p, i = 0, 0
b, c = w[i][0], w[i][1]
while p < n and i < m:
    cur = a[p]
    if cur < c:
        b -= 1
        ans += c
    else:
        ans += cur
    if b == 0:
        i += 1
        if i == m:
            ans += sum(a[p+1:])
            break
        b, c = w[i][0], w[i][1]
    p += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))
w = [tuple(map(int, input().split()))for _ in range(m)]
w.sort(key=lambda x: x[1], reverse=True)
ans = 0
p, i = 0, 0
b, c = w[i][0], w[i][1]

while p < n and i < m:
    cur = a[p]
    if cur < c:
        b -= 1
        ans += c
    else:
        ans += cur
    if b == 0:
        i += 1
        b, c = w[i][0], w[i][1]
    p += 1

print(ans)
Problem p03208 (python)

Fixed submission:
n, k = map(int, input().split())
list_original = []
for i in range(n):
    list_original.append(int(input()))

list = sorted(list_original)
sub = 10000000000

for j in range(n-k+1):
    if list[j+k-1]-list[j] <= sub:
        sub =list[j+k-1]-list[j]
    else:
        pass

print(sub)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
list_original = []
for i in range(n)
    list_original.append(int(input))

list = sorted(list_original)
sub = 10000000000

for j in range(n-k+1):
    if list[j+k-1]-list[j] <= sub:
        sub =list[j+k-1]-list[j]
    else:
        pass

print(sub)
Problem p03209 (python)

Fixed submission:
N, X = map(int, input().split())
a, p = [1], [1]

for i in range(50):
    a.append(a[i]*2+3)
    p.append(p[i]*2+1)

def Burger(N, X):
    if N == 0:
        return 1
    if X == 1:
        return 0
    elif 1 < X <= a[N-1]+1:
        return Burger(N-1, X-1)
    elif X == a[N-1]+2:
        return p[N-1]+1
    else:
        return p[N-1]+1+Burger(N-1, X-2-a[N-1])

print(Burger(N, X))

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

def Burger(L, burger):
    if L == 0:
        return burger
    else:
        burger = "B" + burger + "P" + burger + "B"
        L -= 1
        return Burger(L, burger)

burger_lvX = str(Burger(N, "P"))

print(burger_lvX[:X].count("P"))
Problem p03253 (python)

Fixed submission:
def FACTOR(DICT, N):
    FACT = DICT
    LIM = int(N**0.5)+2
    for i in range(2, LIM):
        if N%i == 0:
            FACT[i] = 0
        while N%i == 0:
            FACT[i] += 1
            N //= i
    if len(FACT) == len(DICT):
        if N != 1:
            FACT[N] = 1
        return FACT
    return FACTOR(FACT, N)

def comb_rep(n, r):
    N = n+r-1
    ANS = 1
    for R in range(r):
        ANS *= N-R
    for R in range(r):
        ANS //= r-R
    return int(ANS)

MOD = 10**9+7
n, m = map(int, input().split())
factor = FACTOR({}, m)
ans = 1
for i in factor:
    ans *= (comb_rep(n, factor[i])%MOD)
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
def FACT(DICT, N):
    FACT = DICT
    LIM = int((N**0.5)//1)+1
    for i in range(2, LIM):
        if N%i == 0:
            FACT[i] = 0
        while N%i == 0:
            FACT[i] += 1
            N //= i
        if len(FACT) == len(DICT):
            FACT[N] = 1
            return FACT
    return FACT(FACT, N)

def comb_rep(n, r):
    N = n+r-1
    ANS = 1
    for R in range(r):
        ANS *= N-R
        ANS /= R+1
    return int(ANS)

MOD = 10**9+7
n, m = map(int, input().split())
factor = FACT({}, m)
ans = 1
for i in factor:
    ans *= comb_rep(n, factor[i])
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
def FACT(DICT, N):
    FACT = DICT
    LIM = int((N**0.5)//1)+1
    for i in range(2, LIM):
        if N%i == 0:
            FACT[i] = 0
        while N%i == 0:
            FACT[i] += 1
            N //= i
        if len(FACT) == len(DICT):
            FACT[N] = 1
            return FACT
    return FACT(FACT, N)

def comb_rep(n, r):
    N = n+r-1
    ANS = 1
    for R in range(r):
        ANS *= N-R
        ANS /= R+1
    return int(ANS)

n, m = map(int, input().split())
factor = FACT({}, m)
ans = 1
for i in factor:
    ans *= comb_rep(n, factor[i])
print(ans)
Problem p03286 (python)

Fixed submission:
n = int(input())

if n == 0:
    print(0)
    exit()

s = ""
while n != 0:
    s += str(n%2)
    n = (n-n%2)//(-2)

print(s[::-1])

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

if N == 0:
    print(0)
    exit()

s = ""
while n != 0:
    s += str(n%2)
    n = (n-n%2)//(-2)

print(s[::-1])
Problem p03631 (python)

Fixed submission:
s = input()

if s[0] == s[2]:
    print("Yes")
else:
    print("No")

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

if b <= c or d <= a:
    print(0)
elif a <= c:
    if b <= d:
        print(b-c)
    else:
        print(d-c)
else:
    if b <= d:
        print(b-a)
    else:
        print(c-b)
Problem p03745 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
inc = False
dec = False
ans = 1

for i in range(n-1):
    if a[i+1] > a[i]:
        if dec:
            ans += 1
            dec = False
        else:
            inc = True
    elif a[i+1] < a[i]:
        if inc:
            ans += 1
            inc = False
        else:
            dec = True

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1
pre = a[0]
increase = True
if a[1] < a[0]:
    increase = False

for i in range(1, n):
    if a[i] < pre:
        if increase:
            ans += 1
            increase = not increase
    elif a[i] > pre:
        if not increase:
            ans += 1
            increase = not increase
    pre = a[i]
print(ans)
Problem p02711 (python)

Fixed submission:
if "7" in str(input()):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
r, g, b = map(s.count, "RGB")
ans = r*g*b
for i in range(n):
    for j in range(i+1, n):
        k = 2*j - i
        if k<n and len(set([s[i], s[j], s[k]])) == 3:
            ans -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
if "7" in str(input()):
  print("Yes")
else:
  print("No)
Problem p02773 (python)

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

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

for i in range(N):
  S.append(str(input()))

cnt_ar = list(set(S))
cnt_ar.sort()

length = len(cnt_ar)

ar = [0]*length

for i in range(length):
  ar[i] = S.count(cnt_ar[i])

max_num = max(ar)

for i in range(length):
  if ar[i] == max_num:
    print(cnt_ar[i])

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

for i in range(N):
  S.append(str(input()))

cnt_ar = list(set(S))
cnt_ar.sort()

length = len(cnt_ar)

ar = [0 for i in range(length)]

for i in range(length):
  ar[i] = S.count(cnt_ar[i])

max_num = max(ar)

for i in range(len(ar)):
  if ar[i] == max_num:
    print(cnt_ar[i])
Problem p02833 (python)

Fixed submission:
import math

N = int(input())

if N==0:
  r=0
elif N%2==1:
  r=0
else:
  rep = int(math.floor(math.log(N,5)))
  r=0
  for i in range(rep):
    q = 5**(i+1)
    if (N//q)%2==0:
      w = (N//q)//2
    else :
      w = ((N-1)//q)//2
    r+=w


print(r)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

rep = int(math.floor(math.log(N,5)))
r=0
for i in range(rep):
  q = 5**(i+1)
  if (N//q)%2==0:
    w = (N//q)//2
  else :
    w = ((N-1)//q)//2
  r+=w

if N%2==1:
  r=0

print(r)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

rep = int(math.floor(math.log(N,5)))
r=0
for i in range(rep):
  q = 5**(i+1)
  if (N//q)%2==0:
    w = (N//q)//2
  else :
    w = ((N-1)//q)//2
  r+=w

if N%2==1:
  r=0

print(r)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

rep = int(math.floor(math.log(N,5)))
r=0
for i in range(rep):
  q = 5**(i+1)
  w = ((N//q)+1)//2
  r+=w

if N%2==1:
  r=0

print(r)
Problem p02759 (python)

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

print((N+1)//2)

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

    print((N+1)//2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(5000)

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

friend_list = [0]*(N+1)
bad_list = [0]*(N+1)
group = {}

parent = [i for i in range(N+1)]

def union(x,y):
    x = find(x)
    y = find(y)
    parent[x] = y

def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x]= find(parent[x])
        return parent[x]



for i in range(M):
    A,B = list(map(int,input().split(' ')))
    friend_list[A]+=1
    friend_list[B]+=1
    
    union(A,B)

for i in range(1,N+1):
    oya = find(i)
    parent[i] = oya
    #print(oya)
    if oya in group:
        group[oya] = group[oya]+1
    else:
        group[oya]=1

for i in range(K):
    A,B = list(map(int,input().split(' ')))
    if find(A)==find(B):
        bad_list[A]+=1
        bad_list[B]+=1
    
    #union(A,B)



#print(parent)
#print('parent')

#print('friend')
#print(friend_list)
#print('bad')
#print(bad_list) 
#print(group)

kouho = [0]*N

for i in range(1,N+1):
    oya = find(i)
    abc = group[oya]-friend_list[i]-bad_list[i]-1
    kouho[i-1] = abc

for k in kouho:
    print(k,end=" ")
print()

#print(parent)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(5000)

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

friend_list = [0]*(N+1)
bad_list = [0]*(N+1)
group = {}

parent = [i for i in range(N+1)]

def union(x,y):
    x = find(x)
    y = find(y)
    parent[x] = y

def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x]= find(parent[x])
        return parent[x]



for i in range(M):
    A,B = list(map(int,input().split(' ')))
    friend_list[A]+=1
    friend_list[B]+=1
    
    union(A,B)

for i in range(1,N+1):
    oya = find(i)
    parent[i] = oya
    #print(oya)
    if oya in group:
        group[oya] = group[oya]+1
    else:
        group[oya]=1

for i in range(K):
    A,B = list(map(int,input().split(' ')))
    if find(A)==find(B):
        bad_list[A]+=1
        bad_list[B]+=1
    
    #union(A,B)



#print(parent)
#print('parent')

#print('friend')
#print(friend_list)
#print('bad')
#print(bad_list) 
#print(group)

kouho = [0]*N

for i in range(1,N+1):
    oya = find(i)
    abc = group[oya]-friend_list[i]-bad_list[i]-1
    kouho[i-1] = abc

for k in kouho:
    print(k,end=" ")
print()

#print(parent)
Problem p02777 (python)

Fixed submission:
S,T = input().split(' ')
A,B = list(map(int,input().split(' ')))
U = input()

if U == S:
    A = A-1
else:
    B=B-1

print(str(A)+' '+str(B))

Buggy submission (verdict: Runtime Error):
S,T = input().split(' ')
A,B = list(map(int,input().split(' ')))
U = input()

if U == S:
    A = A-1
else:
    B=B-1

print(f'{A} {B}')
Problem p02707 (python)

Fixed submission:
n=int(input())
a_list=[int(i) for i in input().split(' ')]

import collections

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]

Buggy submission (verdict: Runtime Error):
n=int(input())
a_list=[int(i) for i in input().split(' ')]

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]
Problem p02711 (python)

Fixed submission:
n=input()

if '7' in str(n):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
answer='No'
for i in str(N):
  if i=='7':
    answer='Yes'
return answer

Buggy submission (verdict: Runtime Error):
answer='No'
for i in str(N):
  if i==7:
    print(answer)
return answer
Problem p02712 (python)

Fixed submission:
n=input()
 
sum=0
 
for i in range(1,int(n)+1):
  if (i%3!=0)&(i%5!=0):
    sum+=i
    
print(sum)

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

sum=0

for i in int(n):
  if (i%3!=0)&(i%5!=0):
    sum+=i
print(sum)
Problem p02915 (python)

Fixed submission:
n=int(input())
print(n**3)

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

ans=0
pre=-1

for i in a:
  ans += b[i-1]
  if(i==pre+1):
    ans += c[i-2]
  pre=i
  
print(ans)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
  if a >= 3200:
  	print("red")
  else:
    print(s)
Problem p02723 (python)

Fixed submission:
S = input()

if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
def coffee():
    if len(S) == 6 and S[2]==S[3] and S[4]==S[5]:
        return 'Yes'

coffee()

Buggy submission (verdict: Runtime Error):
if len(S) == 6 and S[2]==S[3] and S[4]==S[5]:
    print("Yes")
Problem p02987 (python)

Fixed submission:
import collections
S = input()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
a = 0
for i in counts:
    if i==2:
        a += 1
    else:
        a *= 0
if a:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
a = 0
for i in counts:
    if i==2:
        a += 1
    else:
        a *= 0
if a:
    print("Yes")
else:
    print("No")
Problem p03041 (python)

Fixed submission:
import sys

N,K = input().split()
S = input()

N = int(N)
K = int(K)

S_new = S[:K-1] + S[K-1].lower() + S[K:]

print("{}".format(S_new))

Buggy submission (verdict: Runtime Error):
N,M = input().split()
N = int(N)
M = int(M)
list = []
A_list = []

for i in range(M):
    x,y,z = input().split()
    x,y,z = int(x),int(y),int(z)
    list.append([x,y,z])

A_list.append([list[0][0]])
for data in list:
    check = 0
    for A_data in A_list:
        if data[0] in A_data:
            A_data.append(data[1])
            check = 0
        elif data[1] in A_data:
            A_data.append(data[0])
            check = 0
        elif not data[0] in A_data and not data[1] in A_data:
            check = 1
    if check:
        A_list.append([data[0],data[1]])

print(len(A_list))

Buggy submission (verdict: Runtime Error):
N,M = input().split()
N = int(N)
M = int(M)
list = []
A_list = []

for i in range(M):
    x,y,z = input().split()
    x,y,z = int(x),int(y),int(z)
    list.append([x,y,z])

A_list.append([list[0][0]])
for data in list:
    check = 0
    for A_data in A_list:
        if data[0] in A_data:
            A_data.append(data[1])
            check = 0
        elif data[1] in A_data:
            A_data.append(data[0])
            check = 0
        elif not data[0] in A_data and not data[1] in A_data:
            check = 1
    if check:
        A_list.append([data[0],data[1]])

print(len(A_list))
Problem p02790 (python)

Fixed submission:
import numpy as np
a,b=input().split()
# print(a)
# print(b)
a_int =int(a)
b_int = int(b)
# print(a)
# print(b)
c = ""
if(a<b):
    for i in range(b_int):
        c += str(a)
    print(c)

else:
    for i in range(a_int):
        c += str(b)
    print(c)

Buggy submission (verdict: Runtime Error):
import numpy as np
a = input()
b = input()
a_int =int(a)
b_int = int(b)
# print(a)
# print(b)
c = ""
if(a<b):
    for i in range(b_int):
        c += str(a)
    print(c)

else:
    for i in range(a_int):
        c += str(b)
    print(c)
Problem p02915 (python)

Fixed submission:
max = int(input())
print(max ** 3)

Buggy submission (verdict: Runtime Error):
NUM = 3
max = input(data)
print(max**NUM)
Problem p02916 (python)

Fixed submission:
num = int(input())
A_i = [ int(x) for x in input().split()]
B_i = [ int(x) for x in input().split()]
C_i = [ int(x) for x in input().split()]
 
prev = 50
result = 0
for a in A_i:
  result += B_i[a-1]
  if a-1 == prev:
    result += C_i[prev-1]
  prev = a
  
print(result)

Buggy submission (verdict: Runtime Error):
num = int(input())
A_i = [ int(x) for x in input().split()]
B_i = [ int(x) for x in input().split()]
C_i = [ int(x) for x in input().split()]

prev = 0
for a in a_i:
  result += B_i[a]
  if prev > 0 and a-1 == prev:
    result += C_i[prev]
  
print(result)
Problem p02723 (python)

Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from functools import *
from collections import *
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
 
M = 10**9+7

@lru_cache(maxsize=None)
def mod_inv(x):
  if x == 1:
    return 1
  return M // x * -mod_inv(M%x) % M

@lru_cache(maxsize=None)
def calc_subtree(v):
  ret = 1
  size = 1
  for child in Edge[v]:
    Edge[child].remove(v)
    r, s = calc_subtree(child)
    ret = ret * r % M
    size += s
  ret = ret * size % M
  return ret, size

ans = {}
def set_ans(v, a):
  ans[v] = a
  for child in Edge[v]:
    n = calc_subtree(child)[1]
    set_ans(child, ans[v] * n * mod_inv(N-n) % M)

N = int(input())
Edge = defaultdict(set)
fact = N
for i in range(1, N):
  fact = fact * i % M
  a, b = map(int, input().split())
  Edge[a].add(b)
  Edge[b].add(a)

set_ans(1, mod_inv(calc_subtree(1)[0]) * fact % M)
for i in range(1, N+1):
  print(ans[i])
Problem p02729 (python)

Fixed submission:
N, M = map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input())
print(N*(N-1)//2+M*(M-1)//2)

Buggy submission (verdict: Runtime Error):
N, M = input()
print(N*(N-1)//2+M*(M-1)//2)
Problem p02759 (python)

Fixed submission:
N = int(input())

if N%2==0:
    print(int(N/2))
else:
    print(int(N/2 )+ 1)

Buggy submission (verdict: Runtime Error):
A11, A12, A13 = (int(x) for x in input().split())
A21, A22, A23 = (int(x) for x in input().split())
A31, A32, A33 = (int(x) for x in input().split())

N = int(input())

b_list = list()
for i in range(0, N):
    i = int(input())
    b_list.append(i)

A_list = [A11, A12, A13, A21, A22, A23, A31, A32, A33]

for b in b_list:
    for i in range(0, 9):
        if A_list[i] == b:
            A_list[i] = 0

X, Y, Z = 0, 0, 0
for i in range(0, 3):
    k = 3 * i
    if A_list[k] + A_list[k + 1] + A_list[k + 2] == 0:
        X = X + 1
    elif A_list[i] + A_list[i + 3] + A_list[i + 6] == 0:
        Y = Y + 1
    elif A_list[0] + A_list[4] + A_list[8] == 0:
        Z = Z + 1
    elif A_list[2] + A_list[4] + A_list[6] == 0:
        Z = Z + 1
    else:
        continue

if (X+Y+Z) >= 1:
    print('Yes')
else:
    print('No')
Problem p02754 (python)

Fixed submission:
def main():
    N,A,B = map(int,input().split())
    a = N//(A+B)
    b = N - (a * (A+B))
    if b >= A:
        print(a*A+A)
    elif b < A:
        print(a*A+b)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N,A,B = map(int,input().split())
    a = N//(A+B)
    b = N % (a * (A+B))
    print(a*A+b)

if __name__ == "__main__":
    main()
Problem p02711 (python)

Fixed submission:
num = input()
word = list(num)
#print(word)
if word[0] == "7" :
    print("Yes")
elif word[1] == "7" :
    print("Yes")
elif word[2] == "7" :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
word = input().split()
#print(word)
if word[0] == "7" :
    print("Yes")
elif word[1] == "7" :
    print("Yes")
elif word[2] == "7" :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
num = lits(input())
print(num)
if num[0] == "7":
  print("Yes")
elif num[1] == "7":
  print("Yes")
elif num[2] == "7":
  print("Yes")
else:
  print("No")
Problem p02951 (python)

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

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

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

print(c-(a-b))
Problem p03042 (python)

Fixed submission:
#YYMM, MMYY, AMBIGUOUS, NA
S = str(input())

s0 = int(S[0:2])
s1 = int(S[2:])

if s0>12 or s0==0:#YYMM or NA
    if s1>12 or s1==0:
        ans="NA"
    else:
        ans="YYMM"
elif s1>12 or s1==0:#MMYY
    ans="MMYY"
else:
    ans="AMBIGUOUS"
    
print(ans)

Buggy submission (verdict: Runtime Error):
#YYMM, MMYY, AMBIGUOUS, NA
S = str(input())

s0 = int(S[0:2])
s1 = int(S[2:])

if s0>12:#YYMM or NA
    if s1>12:
        ans=="NA"
    else:
        ans=="YYMM"
elif s1>12:#MMYY
    ans="MMYY"
else:
    ans="AMBIGUOUS"
    
print(ans)

Buggy submission (verdict: Runtime Error):
#YYMM, MMYY, AMBIGUOUS, NA
S = str(input())

s0 = int(S[0:2])
s1 = int(S[2:])

if s0>12:#YYMM or NA
    if s1>12:
        ans=="NA"
    else:
        ans=="YYMM"
elif s1>12:#MMYY
    ans="MMYY"
else:
    "AMBIGUOUS"
    
print(ans)
Problem p02754 (python)

Fixed submission:
NAB = list(map(int, input().split()))
N = NAB[0]
A = NAB[1]
B = NAB[2]
ans = ( N//(A+B)) * A

if N%(A+B) <= A:
  ans += N%(A+B)
else:
  ans += A

print(ans)

Buggy submission (verdict: Runtime Error):
N_A_B = list(map(int, input().split()))
ball = ""
num = 10 ** 100
for i in range(num):
  if (len(ball) >= N_A_B[0]):
    break
  ball += "A" * N_A_B[1]
  if (len(ball) >= N_A_B[0]):
    break
  ball += "B" * N_A_B[2]
  if (len(ball) > N_A_B[0]):
    break

print(ball[:N_A_B[0]].count("A"))

Buggy submission (verdict: Runtime Error):
N_A_B = list(map(int, input().split()))
ball = ""
for i in range(10**100):
  ball += "A" * N_A_B[1]
  if (len(ball) >= N_A_B[0]):
    break
  ball += "B" * N_A_B[2]
  if (len(ball) >= N_A_B[0]):
    break

print(ball[:N_A_B[0]].count("A"))

Buggy submission (verdict: Runtime Error):
N_A_B = list(map(int, input().split()))
ball = ""
for i in range(10**100):
  ball += "A" * N_A_B[1]
  ball += "B" * N_A_B[2]
  if (len(ball) > N_A_B[0]):
    break

print(ball[:N_A_B[0]].count("A"))
Problem p02859 (python)

Fixed submission:
print(int(int(input())**2))

Buggy submission (verdict: Runtime Error):
import math
def create_cricle(r):
  return r**2*math.pi
if __name__ == '__main__':
  print(int(create_cricle(input())/create_cricle(1)))
Problem p02847 (python)

Fixed submission:
S = input()
d = {"SUN":7,
     "MON":6,
     "TUE":5,
     "WED":4,
     "THU":3,
     "FRI":2,
     "SAT":1}
print(d[S])

Buggy submission (verdict: Runtime Error):
S = input()
d = {"SUN":6,
     "TUE":5,
     "WED":4,
     "THU":3,
     "FRI":2,
     "SAT":1}
print(d[S])