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

Fixed submission:
def d_c(s):
  count = 0
  x = ''
  for i in range(len(s)):
    if x == s[0]:
      count += 1
      x = ''
    else:
      x = s[0]
    s = s[1:]
  return count
 
def num_con(s):
  x = s[0]
  s = s[1:]
  count = 1
  for i in range(len(s)):
    if s[0] == x:
      count += 1
      x = s[0]
      s = s[1:]
    else:
      break
  return count
      
    
s = input()
k = int(input())
 
if len(s)==1:
  print(k//2)
elif num_con(s)==len(s):
  print((len(s)*k)//2)
elif s[0]==s[-1]:
  f = num_con(s)
  m = num_con(s[::-1])
  dis = (f//2 + m//2 - (f+m)//2)*(k-1)
  print(d_c(s)*k-dis)
else:
  print(d_c(s)*k)

Buggy submission (verdict: Runtime Error):
def d_c(s):
  count = 0
  x = ''
  for i in range(len(s)):
    if x == s[0]:
      count += 1
      x = ''
    else:
      x = s[0]
    s = s[1:]
  return count
 
def num_con(s):
  x = s[0]
  s = s[1:]
  count = 1
  for i in range(len(s)):
    if s[0] == x:
      count += 1
      x = s[0]
      s = s[1:]
    else:
      break
  return count
      
    
s = input()
k = int(input())
 
if len(s)==1:
  print(k//2)
elif num_con(s)==len(s):
  print(d_c(s*k))
elif s[0]==s[-1]:
  f = num_con(s)
  m = num_con(s[::-1])
  dis = (f//2 + m//2 - (f+m)//2)*(k-1)
  print(d_c(s)*k-dis)
else:
  print(d_c(s)*k)

Buggy submission (verdict: Runtime Error):
def d_c(s):
  count = 0
  x = ''
  for i in range(len(s)):
    if x == s[0]:
      count += 1
      x = ''
    else:
      x = s[0]
    s = s[1:]
  return count

s = input()
k = int(input())
if s[0]==s[-1]:
  print(d_c(s*k))
else:
  print(d_c(s)*k)
Problem p02897 (python)

Fixed submission:
n = int(input())

if n==1:
  print(1)
elif n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
key = []

INF = 10**7
p = 1<<n
dp = [INF]*p
dp[0] = 0

for _ in range(m):
    a, _ = map(int, input().split())
    c = sum([1<<(int(i)-1) for i in input().split()])
    def k(s):
        dp[s|c] = dp[s] + a
    [k(s) for s in range(p) if dp[s|c]>dp[s]+a]
ans = dp[-1]
if ans==INF:
    ans = -1
print(ans)
Problem p02594 (python)

Fixed submission:
a = int(input())
if a >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = int(input)
if a >= 30:
  print("Yes")
else:
  print("No")
Problem p02753 (python)

Fixed submission:
S = input()

if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
import math

TAXRATE8 = 0.08
TAXRATE10 = 0.1

tax8, tax10 = map(int, input().split())

amount8_min = math.ceil(tax8 / TAXRATE8)
amount8_max = math.floor((tax8+1) / TAXRATE8)
if ((tax8+1) / TAXRATE8).is_integer():
  amount8_max -= 1


amount10_min = math.ceil(tax10 / TAXRATE10)
amount10_max = math.floor((tax10+1) / TAXRATE10)
if ((tax10+1) / TAXRATE10).is_integer():
  amount10_max -= 1

ans_set = set(range(amount8_min, amount8_max)) & set(range(amount10_min, amount10_max))

if ans_set == set({}):
  print(-1)
else:
  print(min(ans_set))

Buggy submission (verdict: Runtime Error):
N,b,r = map(int, input().split())
 
num = int(N / (b+r))
rest = N - num * (b + r)

if rest >= b:
	print(num * b + b)
else:
	print(num * b + rest)

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

num = int(N / (b+r))
rest = N - num * (b + r)
if rest >= b:
	print(num * b + b)
else:
	print(num * b + rest)
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = map(int,input().split(" "))
can = False
for i in range(a,b+1):
  if i % k == 0:
    can = True
if can:
  print("OK")
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a,b = map(int,input().split().split(" "))
can = False
for i in range(a,b+1):
  if k % i == 0:
    can = True
if can:
  print("OK")
else:
  print("NG")
Problem p02712 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(n):
  if i%3 == 0:
  elif i%5 == 0:
  else:
    sum += i
print(sum)
Problem p02594 (python)

Fixed submission:
x = int(input())
 
if x >= 30:
  ans = 'Yes'
else:
  ans = 'No'
 
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input().split())

if x >= 30:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
 
c = 0
 
for s,t in zip(S,T):
  if s != t:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
import sys
S = input[0]
T = input[1]
leng　= len(S)
int N = 0

for i in leng:
  if S.charAt(i) == T.charAt(j):
    N = N + 1

print (N)
Problem p02627 (python)

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

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

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)

Buggy submission (verdict: Runtime Error):
if input().isupper == true:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
C = input()
 
if C.isupeer:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
if input().isupeer == True:
  ans = "A"
else:
  ans = "a"
  
print(ans)

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

if C.isupeer == True:
  ans = "A"
else:
  ans = "a"
  
print(ans)
Problem p02629 (python)

Fixed submission:
N = int(input())

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)

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

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)

Buggy submission (verdict: Runtime Error):
N = int(input())
 
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0
 
for i in range(1, 1000):
    m += 26**i
    if N <= m:
        n = i
        break

for i in reversed(range(n)):
    a, b = divmod(N, 26**i)
    N = b
    if not a == 0:
      ans += s[a-1]
    else:
      ans += s[25]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
 
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0
 
for i in range(1, 1000):
    m += 26**i
    if N <= m:
        n = i -1
        break

for i in reversed(range(n)):
    a, b = divmod(N, 26**i)
    N = b
    if not a ==0:
      ans += s[a-1]
    else:
      ans += s[25]

print(ans)

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

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
M, n, m = 0, 0, 0

for i in range(1, 1000):
    m += 26**i
    if N <= m:
        M = N + 26**i -m
        n = i - 1
        break

for i in reversed(range(n + 1)):
    a, b = divmod(M, 26**i)
    M = b
    if i == 0:
        ans += s[a-1]
    else:
        ans += s[a]

print(ans)

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

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
M, n, m = 0, 0, 0

for i in range(1, 1000):
    m += 26**i
    if N <= m:
        M = N + 26**i -m
        n = i - 1
        break

for i in reversed(range(n + 1)):
    a, b = divmod(M, 26**i)
    M = b
    if i == 0:
        ans += s[a-1]
    else:
        ans += s[a]

print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
 
s = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""
M,n = 0,0

for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N + 26**i　- m
    n = i-1
    break

for i in reversed(range(n+1)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + s[a]

print(ans)

Buggy submission (verdict: Runtime Error):
N = map(int, input())
 
s = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""
 
for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N + 26**i　- m
    n = i-1
    break

for i in reversed(range(n)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + s[a]

print(ans)

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

C = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""

for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N - m + 26**i
    n = i-1
    break

for i in revesed(range(n)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + C[a]

print(ans)
Problem p02594 (python)

Fixed submission:
a = int(input())
if a>=30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
if (a >= 30):  
    print("Yes")
else
	print("No")
Problem p02594 (python)

Fixed submission:
X= int(input())
if X >= 30:
 print("Yes")
else:
 print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())
If X >= 30:
print("Yes")
else:
print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())
If X >= 30:
print ('Yes')
else:
print('No')

Buggy submission (verdict: Runtime Error):
X = int(input())
If X => 30:
print ('Yes')
else:
print('No')

Buggy submission (verdict: Runtime Error):
X = int(input())
If X =< 30:
print ('Yes')
else:
print('No')
Problem p02595 (python)

Fixed submission:
N, D = map(int, input().split())
ans = 0
for i in range(N):
  X, Y = map(int, input().split())
  if X*X+Y*Y<=D*D:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
ans = 0
for i in range(N)
  X, Y = map(int, input().split())
  if X*X+Y*Y<=D:
    ans += 1
print(ans)
Problem p02595 (python)

Fixed submission:
n, d = map(int, input().split())
cnt = 0
for ti in range(n) :
  x, y = map(int, input().split())
  dist = (x**2 + y**2)**0.5
  if(dist <= d):
    cnt += 1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
cnt = 0
for ti in n :
  x, y = map(int, input().split())
  dist = (x**2 + y**2)**0.5
  if(dist >= d):
    cnt += 1
    
print(cnt)
Problem p02594 (python)

Fixed submission:
temp = input()
temp = int(temp)
if temp<-40 or temp>40:
    print('Out')    
elif temp >=30: 
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
tep = input()
if tep<-40 or tep>40:
  break
elif tep >=30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
tep = input()
if tep>=30:
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
tep = input()
if tep>=30:
	print('Yes')
else:
	print('No')
Problem p02595 (python)

Fixed submission:
import numpy as np
N,D = input().strip().split()
N = int(N)
D = int(D)
count = 0
for i in range(N):
    x,y = input().strip().split()
    x = int(x)
    y = int(y)
    #print(x**2)
    dist = np.sqrt((x)**2+(y)**2)
    #print(dist)
    if dist <= D:
        count +=1
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
# 行数
N,D = input().strip().split()
N = int(N)
D = int(D)
# 2次元配列
grid = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    grid.append(array)
    
count = 0
for i in range(0,N):
  dist = sqrt(grid[i][0]^2+grid[i][1]^2)
  if dist <= D:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
x,y = int(input())
N = x[0]
D = y[0]
count = 0
for i in range(1,N):
  dist = sqrt(x[i]^2+y[i]^2)
  if dist <= D:
    count += 1
print(count)
Problem p03327 (python)

Fixed submission:
N=int(input())

if N < 1000:
    print("ABC")
else:
    print("ABD")

Buggy submission (verdict: Runtime Error):
A, B = input().split()
a = int(A)
ans = 0

for i in range(a - 1):
    ans += i

print(ans)
Problem p03804 (python)

Fixed submission:
import sys

n, m = map(int, input().split())
a_array = [input() for i in range(n)]
b_array = [input() for i in range(m)]

for ai in range(n-m+1):
    for aj in range(n-m+1):
        can = True
        for bi in range(m):
            if a_array[ai+bi][aj:aj+m] != b_array[bi]:
                can = False
                break
        if can:
            print('Yes')
            sys.exit()

print('No')

Buggy submission (verdict: Runtime Error):
import sys

n, m = map(int, input().split())
a_array = [input() for i in range(n)]
b_array = [input() for i in range(m)]

for ai in range(n):
    for aj in range(n):
        can = True
        for bi in range(m):
            if a_array[ai+bi][aj:aj+m] != b_array[bi]:
                can = False
                break
        if can:
            print('Yes')
            sys.exit()

print('No')
Problem p02594 (python)

Fixed submission:
x = int(input())
if x<30:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
x = int(input)
if x<30:
  print('Yes')
 else:
  print('No')
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

if M == 0:
    maxM = N
else:
    maxM = a[0] - 1
    for i in range(1, M):
        maxM = max(maxM, a[i] - a[i-1] - 2)
    maxM = max(maxM, N - a[-1])

dp = [0] * (maxM+1)
dp[1] = 1
if maxM > 1:
    dp[2] = 2
    if maxM > 2:
        for n in range(3, maxM+1):
            dp[n] = (dp[n-1] + dp[n - 2]) % 1000000007

if M == 0:
    print(dp[-1])
    exit()

if a[0] == 1:
    ans = 1
else:
    ans = dp[a[0] - 1]

if M > 1:
    for i in range(1, M):
        if a[i] - a[i - 1] == 1:
            ans = 0
        elif a[i] - a[i - 1] == 2:
            continue
        else:
            ans = ans * dp[a[i] - a[i - 1] - 2] % 1000000007
if N - a[-1] != 1:
    ans = ans * dp[N - a[-1] - 1] % 1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(10 ** 6)

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [0] * N
dp[1] = 1
dp[2] = 2


def fib(n):
    if n == 0:
        return 0
    elif dp[n] == 0:
        dp[n] = fib(n - 1) + fib(n - 2)
    return dp[n]


if a[0] == 1:
    ans = 1
else:
    ans = fib(a[0] - 1)
if M > 1:
    for i in range(1, M):
        if a[i] - a[i - 1] <= 1:
            ans = 0
        else:
            ans = ans * fib(a[i] - a[i - 1] - 2) % 1000000007
ans = ans * fib(N - a[-1] - 1) % 1000000007
print(ans)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
L = [tuple(map(int, input().split())) for _ in range(M)]

L.sort(key=lambda x: x[1], reverse=True)

flag = True
num = 0
now = 0
while flag:
    if num >= M:
        break
    for i in range(L[num][0]):
        if now < N and L[num][1] > A[now]:
            A[now] = L[num][1]
            now += 1
        else:
            flag = False
            break
    num += 1
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
L = [tuple(map(int, input().split())) for _ in range(M)]

L.sort(key=lambda x: x[1], reverse=True)

flag = True
num = 0
now = 0
while flag:
    if num >= M:
        break
    for i in range(L[num][0]):
        if now <= N and L[num][1] > A[now]:
            A[now] = L[num][1]
            now += 1
        else:
            flag = False
            break
    num += 1
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
L = [tuple(map(int, input().split())) for _ in range(M)]

L.sort(key=lambda x: x[1], reverse=True)

flag = True
num = 0
now = 0
while flag:
    if num >= M:
        break
    for i in range(L[num][0]):
        if L[num][1] > A[now]:
            A[now] = L[num][1]
            now += 1
        else:
            flag = False
            break
    num += 1
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
L = [tuple(map(int, input().split())) for _ in range(M)]

L.sort(key=lambda x: x[1], reverse=True)

flag = True
num = 0
now = 0
while num < M:
    for i in range(L[num][0]):
        if L[num][1] > A[now]:
            A[now] = L[num][1]
            now += 1
        else:
            flag = False
            break
    num += 1
print(sum(A))
Problem p03053 (python)

Fixed submission:
# 参考

import numpy

H, W = map(int, input().split())
values = [None] * H

for y in range(H):
    values[y] = [0 if v == "#" else H + W for v in input()]
values = numpy.array(values)

for x in range(W - 1):
    values[:, x + 1] = numpy.minimum(values[:, x] + 1, values[:, x + 1])

for x in range(W - 1, 0, -1):
    values[:, x - 1] = numpy.minimum(values[:, x] + 1, values[:, x - 1])

for y in range(H - 1):
    values[y + 1, :] = numpy.minimum(values[y, :] + 1, values[y + 1, :])

for y in range(H - 1, 0, -1):
    values[y - 1, :] = numpy.minimum(values[y, :] + 1, values[y - 1, :])

print(numpy.max(values))

Buggy submission (verdict: Runtime Error):
from collections import deque


def inside(x, l, r):
    return l <= x < r


H, W = map(int, input().split())
A = [list(input()) for i in range(H)]
qu = deque()

rest = H * W
for i in range(H):
    for j in range(W):
        if A[i][j] == '#':
            rest -= 1
            qu.put((i, j))

ans = 0
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]
while True:
    if rest == 0:
        break
    ans += 1
    qu2 = deque()
    while qu:
        i0, j0 = qu.get()
        for k in range(4):
            ni = i0 + dx[k]
            nj = j0 + dy[k]
            if not (inside(ni, 0, H) and inside(nj, 0, W)):
                continue
            if A[ni][nj] == '.':
                A[ni][nj] = '#'
                rest -= 1
                qu2.put((ni, nj))
    qu = qu2
print(ans)
Problem p03075 (python)

Fixed submission:
List = list(map(int, [input() for _ in range(5)]))
k = int(input())

if List[4] - List[0] <= k:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
K = int(input().split()[3])
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

ans = []
for i in range(len(A)):
    for j in range(len(B)):
        if (i+1) * (j+1) > K:
            break
        for k in range(len(C)):
            if (i+1)*(j+1)*(k+1) > K:
                break
            ans.append(A[i]+B[j]+C[k])
ans.sort(reverse=True)
for _ in range(K):
    print(ans[_])
Problem p02847 (python)

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

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

Buggy submission (verdict: Runtime Error):
print(input()[{
  "SAT": 1
  "FRI": 2,
  "THU": 3,
  "WED": 4,
  "TUE": 5,
  "MON": 6,
  "SUN": 7
}])
Problem p02594 (python)

Fixed submission:
print("Yes" if int(input()) >= 30 else "No")

Buggy submission (verdict: Runtime Error):
return int(input()) >= 30
Problem p03252 (python)

Fixed submission:
s = input()
t = input()
used_str = []
for i in range(len(s)):
  if s[i] != t[i] and not s[i] in used_str and not t[i] in used_str:
    s = s.translate(str.maketrans(s[i]+t[i],t[i]+s[i]))
    used_str.append(s[i])
    used_str.append(t[i])

if s == t:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
for i in range(len(s)):
  if s[i] == t[i]:
  else:
    s = s.translate(str.maketrans(s[i]+t[i],t[i]+s[i]))

if s == t:
  print("Yes")
else:
  print("No")
Problem p02594 (python)

Fixed submission:
X = int(input())
if X >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X = input()
if X >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def close_aircondition(x):
  if x >= 30:
    print("Yes")
  else:
    print('No')

if __name__ == "__main__":
  X = input()
  close_aircondition(X)
Problem p02987 (python)

Fixed submission:
import string
s = input()
d = {i:0 for i in string.ascii_uppercase}
for i in s:
  d[i] += 1

def solve():
  for i in d.values():
    if i not in [0, 2]:
      print("No")
      return
  print("Yes")

solve()

Buggy submission (verdict: Runtime Error):
import string
s = input()
d = {i:0 for i in string.ascii_uppercase}
for i in s:
  d[i] += 1

def solve():
	for i in d.values():
	  if i not in [0, 2]:
	    print("No")
        return
    print("Yes")

solve()
Problem p03041 (python)

Fixed submission:
n, k = [int(x) for x in input().strip().split()]
s = input().strip()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n, k = [int(x) for x in input().strip().split()]
s = input().strip()
s[k-1:k] = s[k-1].lower()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n, k = [int(x) for x in input().strip().split()]
s = input().strip()
s[k-1] = s[k-1].lower()
print(s)
Problem p03077 (python)

Fixed submission:
ri = lambda: int(input())
n = ri()
x = min([ri() for _ in range(5)])
print(n//x+min(1,n%x)+4)

Buggy submission (verdict: Runtime Error):
ri = lambda: int(input())
n = ri()
x = min([ri() for _ range(5)])
print(n//x+min(1,n%x)+4)
Problem p02595 (python)

Fixed submission:
n, d = map(int,input().split())
ans = 0
 
for i in range(n):
  x, y = map(int,input().split())
  z = (x**2 + y**2)**0.5
  if z <= d:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n, d = map(int,input().split())
ans = 0

for i in range(x):
  x, y = map(int,input().split())
  z = (x**2 + y**2)**0.5
  if z <= d:
    ans += 1

print(ans)
Problem p02753 (python)

Fixed submission:
s = input()
 
if s == "AAA" or s == "BBB":
  print("No")
else:
  print("Yes")

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

if s = "AAA" or s = "BBB":
  print("No")
else:
  print("Yes")
Problem p02754 (python)

Fixed submission:
n, a, b = map(int,input().split())
 
x = int(n/(a+b)) #何周目か
y = n%(a+b) #余り

if y > a:
    ans = (x+1) * a
else:
    ans = x * a + y

print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
 
x = int(n/(a+b)) #何周目か
y = n%(a+b)

if y > a:
    ans = (x+1) * a
else:
    x * a + y

print(ans)
Problem p02779 (python)

Fixed submission:
import collections

n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)

if c.most_common()[0][1] == 1:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import collection

n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)

if c.most_common()[0][1] == 1:
    print("Yes")
else:
    print("No")
Problem p02785 (python)

Fixed submission:
n, k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
ans = 0

if k > n:
  ans = 0
  
else:
  ans = sum(h) - sum(h[:k])
  
print(ans)

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

x,y = [long(x) for x in stdin.readline().rstrip().split()]
li = list(map(long,stdin.readline().rstrip().split()))

z = 0
if(x<y):
    print(z)

else:
    li = li.sort(reverse=True)
    del li[0:y-1]

    z = 0
    for i in li:
        z = z + i

    print(z)
Problem p02832 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
x = 1
ans = 0

for i in a:
    if i == x:
        ans += 1
        x += 1

if ans == 0:
    print(-1)
else:
    print(len(a)-ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
j = 0
k = 0

if 1 not in a:
    print(-1)
else:   
    for i in range(1,n+1):
        if i in a[k:]:
            j = j + 1
            k = a[k:].index(i) + k
        else:
            break
    print(n-j)

Buggy submission (verdict: Runtime Error):
n = int(input())
i = [int(input()) for i in range(n)]
j = 0
k = 0

if 1 not in a:
    print(-1)
else:   
    for i in range(1,n+1):
        if i in a[k:]:
            j = j + 1
            k = a[k:].index(i) + k
        else:
            break
    print(n-j)
Problem p03041 (python)

Fixed submission:
n, k = map(int,input().split())
s = input()
print(s[:k-1] + s.lower()[k-1] + s[k:n])

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

s[k-1] = s[k-1].lower()

print(s)