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

Fixed submission:
# coding: utf-8
# Your code here!
#a = list(map(int, input().split()))
i=int(input())
lst = []

while i > 0:
    lst.append(i%10)
    i //= 10 # 必須
lst.reverse()
if len(lst)==3:
    lst.insert(0,0)
elif len(lst)==2:
    lst.insert(0,0)
    lst.insert(1,0)
elif len(lst)==1:
    lst.insert(0,0)
    lst.insert(1,0)
    lst.insert(2,0)
elif len(lst)==0:
    lst.insert(0,0)
    lst.insert(1,0)
    lst.insert(2,0)
    lst.insert(3,0)
#print(str(lst[0])+str(lst[1]))
#print(str(lst[2])+str(lst[3]))

if (int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12) or (int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12):
    if (int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12) and (int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12):
        print("AMBIGUOUS")
    elif int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12:
        print("MMYY")
    elif int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12:
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
#a = list(map(int, input().split()))
i=int(input())
lst = []

while i > 0:
    lst.append(i%10)
    i //= 10 # 必須
lst.reverse()
if len(lst)==3:
    lst.insert(0,0)

#print(str(lst[0])+str(lst[1]))
#print(str(lst[2])+str(lst[3]))

if (int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12) or (int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12):
    if (int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12) and (int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12):
        print("AMBIGUOUS")
    elif int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12:
        print("MMYY")
    elif int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12:
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
#a = list(map(int, input().split()))
i=int(input())
lst = []

while i > 0:
    lst.append(i%10)
    i //= 10 # 必須
lst.reverse()
if len(lst)==3:
    lst.insert(0,0)

#print(str(lst[0])+str(lst[1]))
#print(str(lst[2])+str(lst[3]))

if (int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12) or (int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12):
    if (int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12) and (int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12):
        print("AMBIGUOUS")
    elif int(str(lst[0])+str(lst[1]))>=1 and int(str(lst[0])+str(lst[1]))<=12:
        print("MMYY")
    elif int(str(lst[2])+str(lst[3]))>=1 and int(str(lst[2])+str(lst[3]))<=12:
        print("YYMM")
else:
    print("NA")
Problem p03803 (python)

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

if a==b:
    print("Draw")
    exit()
elif b==1:
    print("Bob")
    exit()
elif a==1:
    print("Alice")
    exit()
if a>b:
    print("Alice")
elif a<b :
    print("Bob")
else:
    print("Draw")

Buggy submission (verdict: Runtime Error):
a,b = map(list(map,input().split(" ")))
if a>b:
    print("Alice")
elif a<b :
    print("Bob")
else:
    print("Draw")
Problem p03186 (python)

Fixed submission:
a, b, c = map(int, input().split())
if c <= a+b:
    print(b+c)
else:
    print(2*b+a+1)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a+b >= c:
    c = c + 1
    
else a + b < c:
    c = c  + 1
print(c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b + 1 >= c:
    c = b + c
    
elif a + b < c:
    c = a + b  + 1 + b
input(c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b + 1 >= c:
    c = b + c
    
elif a + b > c:
    c = a + b  + 1 + b
input(c)
Problem p03307 (python)

Fixed submission:
n=int(input())
if n%2==0:
  print(n)
else:
  print(2*n)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(n)
else:
  print(2*n)
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
A_=input(A?)
B_=input(B?)
C_=input(C?)
s=C_-A_+B_
print(s)
Problem p02959 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
x=0
for i in range(N):
  if A[i]+A[i+1]<=B[i]:
    x+=A[i]+A[i+1]
    A[i+1]=0
  elif A[i]>=B[i]:
    x+=B[i]
  elif A[i]<B[i]:
    x+=B[i]
    A[i+1]=A[i+1]-(B[i]-A[i])
print(x)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
x=0
for i in range(N+1):
  if A[i]+A[i+1]<=B[i]:
    x+=A[i]+A[i+1]
    A[i+1]=0
  if A[i]>=B[i]:
    x+=B[i]
  if A[i]<B[i]:
    x+=B[i]
    A[i+1]=A[i+1]-(B[i]-A[i])
print(x)
Problem p02970 (python)

Fixed submission:
n, d = map(int, input().split())
print(1 + n//(2*d+1)) if n%(2*d+1) else print(n//(2*d+1))

Buggy submission (verdict: Runtime Error):
N,D=map(int,input().split())
m=(N-1)//(2D+1)
n=m+1
print(n)
Problem p02989 (python)

Fixed submission:
N=int(input())
List=list(map(int,input().split()))
List.sort()
l=int(N/2)
k=int(N/2-1)
m=List[l]-List[k]
print(m)

Buggy submission (verdict: Runtime Error):
N=int(input())
List=list(map(int,input().split()))
D=List.sort()
m=D[N&2]-D[N%2-1]-1
if m=-1:
  print(0)
else:
  print(m)
Problem p03072 (python)

Fixed submission:
N=int(input())
List=list(map(int,input().split()))
count=1

for i in range(1,N):
    W=0
    for j in range(i):
        if List[j]>List[i]:
            W+=1
    if W==0:  
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
 N=int(input())
List=list(map(int,input().split()))
count=1
for i in range(1,N):
    for j in range(i):
        w=0
        if List[j]>List[i]:
            w+=1
    if w==0:  
        count+=1
print(count)
Problem p02951 (python)

Fixed submission:
input = input().split()
A = int(input[0])
B = int(input[1])
C = int(input[2])
 
X = C - (A - B)
if X < 0: X = 0
print(X)

Buggy submission (verdict: Runtime Error):
input = input()
A = int(input[0])
B = int(input[1])
C = int(input[2])

X = C - (A - B)
print(X)
Problem p02951 (python)

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

if A-B>=C:
    print(0)
else:
    print(C-(A-B))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
1<=B<=A<=20
1<=C<=20
D = A-B
if D>C:
    E = C-C
else:
    E = D-C

E

Buggy submission (verdict: Runtime Error):
A B C
D = B-A
E = C-D
E
Problem p03075 (python)

Fixed submission:
a = [int(input()) for i in range(6)] 
f = a[4] - a[0]
if f > a[5]:
    print(':(')
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, k = map(int, input().split())
f = int(e-a)
if f > k:
    print(':(')
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, k = map(int, input().split())
f = e-a
if f > k:
    print(':(')
else:
    print('Yay!')
Problem p02951 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A - B >= C:
  r = 0
else:
  r = C - (A - B)
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = map(int, input().split())
H = list(H)
res = 'Yes'
for i in range(len(H) - 1):
  for j in range(i + 1, len(H)):
    if H[i] - H[j] >= 2:
      res = 'No'
      break
  if res == 'No':
    break
print(res)
Problem p02951 (python)

Fixed submission:
A, B, C = (int(i) for i in input().split(" "))
 
D = A - B

 
if C - D <= 0:
  print(0)
else:
  print(C-D)

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

if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(9+ N-99)
elif N < 10000:
  print(909)
elif N < 100000:
  print(909 + N - 9999)
else:
  print(90909)

Buggy submission (verdict: Runtime Error):
N=int(input())
 
if N < 10:
  print(N)
  
elif N < 100:
  print(9)

  
elif N < 1000:
  print(9+ N-99)
  
  
elif N < 10000:
  print(909)
  
elif N < 100000:
  print(909 + N - 9999)

else:
  print(90909)

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

if N < 10:
  print(N)
  
elif N < 100:
  print(9)
  
elif N < 1000:
  print(9+ N-99)
  
elif N < 10000:
  print(909)

elif N < 100000:
  print(909 + N - 9999)

else:
  print(90909)

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

if N < 10:
  print(N)
  
elif N < 100:
  print(9)
  
elif N < 1000:
  print(9+ N-99)
  
elif N < 10000:
  print(909)

elif N < 100000:
  print(909 + N - 9999)

else:
  print(90909)

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


if N < 10:
  print(N)
  
elif N < 100:
  print(9)
  
elif N < 1000:
  print(9+ N-99)
  
elif N < 10000:
  print(909)

elif N < 100000:
  print(909 + N - 9999)

else:
  print(90909)

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


if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(9+ N-99)
  
elif N < 10000:
  print(909)

elif N < 100000:
  print(90909)

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

num = 0
if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(9+ n-99)
  
elif N <10000:
  print(909)

elif N < 100000:
  print(90909)

Buggy submission (verdict: Runtime Error):
A, B, C = input().split(" ")
 
D = A - B

 
if C - D <= 0:
  print(0)
else:
  print(C-D)

Buggy submission (verdict: Runtime Error):
A, B, C = input()
 
D = A - B

 
if C - D <= 0:
  print(0)
else:
  print(C-D)

Buggy submission (verdict: Runtime Error):
A, B, C = input()

D = A - B


if C - D <= 0:
  print(0)
else:
  print(C-D)
Problem p02951 (python)

Fixed submission:
#https://atcoder.jp/contests/abc136/tasks/abc136_a

A,B,C=(int(x) for x in input().split())
i=0

if 1<=B<=A<=20 and 1<=C<=20:
    i=C-(A-B)
    if i<0:
        i=0
else:
    print('condition failed')

print(i)

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc136/tasks/abc136_a

print(' A = ')
A = input()
A =int(A)

print(' B = ')
B = input()
B =int(B)

print(' C = ')
C = input()
C =int(C)

if 1<=B<=A<=20 and 1<=C<=20:
    i=C-(A-B)
else:
    print('condition failed')

print('C have',i)
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(min( C - (A - B), 0)
Problem p03077 (python)

Fixed submission:
a = input()
s = input()
d = input()
f = input()
g = input()
h = input()
j = min(int(s), int(d), int(f), int(g), int(h))

if int(a)%j == 0:
    k = int(a)//j + 4
else:
    k = int(a)//j + 5
print(k)

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
d = input()
f = input()
g = input()
h = input()
j = min(int(s), int(d), int(f), int(g), int(h))

if int(a)%j == 0:
    k = int(a)//j + 4
else:
    k = int(a)//j + 5
print(i)

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
d = input()
f = input()
g = input()
h = input()
j = min(int(s), int(d), int(f), int(g), int(h))

if int(a)%j = 0:
    k = int(a)//j + 4
else:
    k = int(a)//j + 5
print(i)
Problem p03127 (python)

Fixed submission:
import math
from functools import reduce
aaa = int(input())
baa = list(map(int, input().split()))


def gcd (a,b):
    if (b == 0):
        return a
    else:
        return gcd(b, a % b)
res = baa[0]
for c in baa[1::]:
    res = gcd(res , c)
print(res)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
a = int(input())
b = list(map(int, input().split()))

d = 0


def gcd(*numbers):
    return reduce(math.gcd, numbers)


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


print(gcd_list(b))
Problem p02987 (python)

Fixed submission:
S = input()
if len(set(S)) == 2 and S.count(list(set(S))[0]) == 2 and S.count(list(set(S))[1]) == 2:
    print ('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()
if len(set(s)) == 2:
    for i in list(set(s)):
        if not S.count(i) == 2:
            print('No')
        else:
            print('Yes')
else:
    print('No')
Problem p03011 (python)

Fixed submission:
p,q,r = map(int, input().split())
print(min(p+q, q+r, r+p))

Buggy submission (verdict: Runtime Error):
times=list(map(int, input().split()))
time=[]
for i in range(len(times)):
    for j in range(len(times)):
        if times.index(times[i]) == times.index(times[j]):
            continue
        
        time.append(times[i]+times[j])

print (min(time))
Problem p02951 (python)

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

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

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

for i in range(N):
	students.append(list(map(int, input().split())))

for i in range(M):
	checkpoints.append(list(map(int, input().split())))

ans = [0] * N

for i in range(N):
	mindif = 4 * 10**8 + 1
	for j in range(M):
		dif = abs(students[i][0] - checkpoints[j][0]) + abs(students[i][1] - checkpoints[j][1])
		if dif < mindif:
			mindif = dif
			ans[i] = j + 1

for i in range(N):
	print(ans[i])

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
students = list()
checkpoints = list()

for i in range(N):
	students.append(list(map(int, input().split())))

for i in range(M):
	checkpoints.append(list(map(int, input().split())))

ans = [0] * N

for i in range(N):
	mindif = 4 * 10**8 + 1
	for j in range(M):
		dif = abs(students[i][0] - checkpoints[j][0]) + abs(students[i][1] - checkpoints[j][1])
		if dif < mindif:
			mindif = dif
			ans[i] = j

for i in range(M):
	print(ans[i])
Problem p02951 (python)

Fixed submission:
a,b,c = map(int,(input().split()))
ans = c-(a-b)
if ans <= 0:
    ans = 0
else:
    pass
print(ans)

Buggy submission (verdict: Runtime Error):
N = int (input())
H = list(map(int,input().split()))
ans = 'Yes'
for  i in range(N-1):
    diff = H[i+1] - H[i]
    if diff >= 1:
        H[i+1] -= 1
    elif diff < 0:
        ans ='No'
print(ans)

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

for x in range(n-1):
    if h[x] <= h[x+1]:
        pass
    else:
        h[x] = h[x]-1

if n == 1:
    ans ='Yes'
for x in range(n-1):
    if h[x] <= h[x+1]:
        ans = 'Yes'
    else:
        ans = 'No'
        break
print(ans)
Problem p02951 (python)

Fixed submission:
a, b, c = (int(x) for x in input().split())
if c > (a-b):
    print(c-(a-b))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(x) for x in input().split()]
h_max = max(h)

if n == 1:
    print('Yes')
elif h_max - 1 <= h[n-1]:
    print('Yes')
else:
    print('No')
Problem p02951 (python)

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

print(c-min(a-b,c))

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

print("{}-{}+{}".format(c,a,b)
Problem p02951 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b+c > a:
  print(b+c-a)
else:
  print("0")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if b+C > a:
  print((b+c-a)
else:
  print("0")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if b+C > a:
  print((b+c)-a)
else:
  print("0")
Problem p02951 (python)

Fixed submission:
inputs=list(map(int, input().split()))
ans = inputs[2] - min(inputs[0]-inputs[1], inputs[2])
print("{}".format(ans))

Buggy submission (verdict: Runtime Error):
inputs=list(map(int, input().split()))
print(f"{inputs[2] - min(inputs[0]-inputs[1], inputs[2])}")
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
A, B, C = map(int,input().split())
if B+C <=A {
  print(0)
}else{
C=B+C-A
  print(C)
}

Buggy submission (verdict: Runtime Error):
A, B, C = map(int,input().split())
if B+C <=A{
  C=0
}else{
C=B+C-A
}
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
ans = "Yes"
b = 0
for i in range(N):
        b = max(b,li[i])
        if b > li[i]+1:
                ans = "No"
        

print(ans)
Problem p02951 (python)

Fixed submission:
A,B,C = map(int,input().split())
ans = C-(A-B)
if ans<=0:
  print(0)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-1):
  if H[i]-H[i+1]=1:
    H[i] = H[i]-1
  elif H[i]-H[i+1]>1:
    cnt = 1
    break
if cnt == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-1):
  if H[i]-H[i+1]=1:
    H[i] = H[i]-1
  elif H[i]-H[i+2]>1:
    cnt = 1
    break
if cnt == 0:
  print('Yes')
else:
  print('No')
Problem p02970 (python)

Fixed submission:
N,D = map(int,input().split())
S = 0
cnt = 0
while S < N:
  S += 1+2*D
  cnt +=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N,D = map(int(input().split()))
sum = 1
cnt = 0
while sum > N:
  sum += 2D
  cnt += 1

print(cnt)
Problem p02987 (python)

Fixed submission:
S = list(input())
S.sort()
if S[0]==S[1] and S[2]==S[3] and S[1] !=S[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
S.sort()
if S[0]==S[1] and S[2]==S[3] and S[1] !=S[2]:
  print("Yes")
else:
  print("No")
Problem p03011 (python)

Fixed submission:
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = [a,b,c]
print(min(d))

Buggy submission (verdict: Runtime Error):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(min(d))

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(d.min())
Problem p03012 (python)

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
i = 0
W_sum = sum(W)
ans_l = []
tmp_l = 0
for i in range(N):
    tmp_l += W[i]
    if((W_sum-tmp_l) - tmp_l < 0):
        ans_l.append(-((W_sum-tmp_l) - tmp_l))
    else:
        ans_l.append((W_sum-tmp_l) - tmp_l)
print(min(ans_l))

Buggy submission (verdict: Runtime Error):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))

Buggy submission (verdict: Runtime Error):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))
Problem p03041 (python)

Fixed submission:
N,K = map(int,input().split())
S = input()
n = K-1
ans = ""
for i in range(N):
    if i == n:
        ans = ans +S[i].lower()
    else:
        ans = ans + S[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=list(input())
S[K-1]=S[K-1].lower()
print("".join(K))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K-1]=='A':
  S[K-1]='a'
  elif S[K-1]=='B':
    S[K-1]='b'
    else:
      S[K-1]='c'
print(S)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K-1]=='A':
  S[K-1]='a'
elif S[K-1]=='B':
    S[K-1]='b'
else:
     S[K-1]='c'
print(S)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K-1]=='A':
  S[K-1]='a'
elif S[K-1]=='B':
    S[K-1]='b'
else:
     S[K-1]='c'
print(S)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[K]=='A':
  S[K]='a'
elif S[K]=='B':
    S[K]='b'
else:
     S[K]='c'
print(S)
Problem p03242 (python)

Fixed submission:
N = input()
print(N.translate(str.maketrans({'1': '9', '9': '1'})))

Buggy submission (verdict: Runtime Error):
N = input()
for i in range(3):
  if N[i] == '1':
    N[i] = '9'
  else:
    N[i] = '1'
 
print(N)
Problem p03250 (python)

Fixed submission:
import statistics
N = list(map(int,input().split()))
A = max(N)
B = min(N)
C = sum(N)-A-B
print(A*10+B+C)

Buggy submission (verdict: Runtime Error):
import statistics
N = list(map(int,input().split()))
A = max(N)
B = min(N)
C = median(N)
print(A*10+B+C)
Problem p03835 (python)

Fixed submission:
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 <= K and (S-l)>=0:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)

Buggy submission (verdict: Runtime Error):
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 =< K:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)

Buggy submission (verdict: Runtime Error):
K,S = map(int,input().split())
div = (K+1)//3
one = 0
three = 0
six = 0
for l in range(div):
  for m in range(l+1,div):
    for n in range(m+1,div):
      if l+m+n == S:
        six +=1
if S%3 == 0:
  one = 1
for i in range(K+1):
  if (S-i)%2 ==0 and S%3!=0:
    two +=1

print(one+3*three+6*six)
Problem p03127 (python)

Fixed submission:
import fractions
import itertools
from functools import reduce
# print(math.gcd(1000000000, 1000000000))


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

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

result = 10 ** 9 + 1

print(gcd(*monsters))

Buggy submission (verdict: Runtime Error):
import math
import itertools
# print(math.gcd(1000000000, 1000000000))

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

result = 10 ** 9 + 1

for comb in list(itertools.combinations(monsters,2)):
    gcd = math.gcd(comb[0], comb[1]) 
    if gcd < result:
        result = gcd

print(result)
Problem p02987 (python)

Fixed submission:
s = list(input())
s.sort()
if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = list(input().split())
s.sort()

if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
s.sort()
if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')
Problem p03011 (python)

Fixed submission:
lst = list(map(int, input().split()))
lst.sort()
 
print(lst[0] +lst[1])

Buggy submission (verdict: Runtime Error):
lst = [map(int, input().split())]
lst.sort()
 
print(lst[0] +lst[1])

Buggy submission (verdict: Runtime Error):
p, q, r = map(int, input().split())
lst = []
lst.extend(p, q, r)
lst.sort()

print(lst[0] +lst[1])
Problem p02951 (python)

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

D = C - (A-B)
if D < 0:
  print(0)
else:
  print(D)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
      ans += 1
      
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 is 1:
      ans += 1
      
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 is 1:
      ans += 1
      
print(ans)