Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import sys

N=int(input())
S=[int(input()) for _ in range(N)]
ans=0

if sum(S)%10!=0:
  print(sum(S))
  sys.exit()

i=N-1
while True:
  if ans!=0 or i==0:
    break
  for j in itertools.combinations(S,i):
    s=sum(j)
    if s%10!=0:
      ans=max(ans,s)
  i-=1

print(ans)

Fixed submission:
import sys

N=int(input())
S=[int(input()) for _ in range(N)]
S.sort()
ans=sum(S)

if ans%10!=0:
  print(ans)
  sys.exit()
else:
  for i in range(N):
    if S[i]%10!=0:
      print(ans-S[i])
      sys.exit()
  else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import sys

N=int(input())
S=[int(input()) for _ in range(N)]
ans=0

if sum(S)%10!=0:
  print(sum(S))
  sys.exit()

i=N-1
while True:
  if ans!=0 or i==0:
    break
  for j in itertools.combinations(S,i):
    s=sum(j)
    if s%10!=0:
      ans=max(ans,s)

print(ans)

Fixed submission:
import sys

N=int(input())
S=[int(input()) for _ in range(N)]
S.sort()
ans=sum(S)

if ans%10!=0:
  print(ans)
  sys.exit()
else:
  for i in range(N):
    if S[i]%10!=0:
      print(ans-S[i])
      sys.exit()
  else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N=int(input())
S=[int(input()) for _ in range(N)]
ans=0

for i in range(1,N+1):
  for j in itertools.combinations(S,i):
    s=sum(j)
    if s%10!=0:
      ans=max(ans,s)
print(ans)

Fixed submission:
import sys

N=int(input())
S=[int(input()) for _ in range(N)]
S.sort()
ans=sum(S)

if ans%10!=0:
  print(ans)
  sys.exit()
else:
  for i in range(N):
    if S[i]%10!=0:
      print(ans-S[i])
      sys.exit()
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import itertools
import sys
 
N,A,B=map(int,input().split())
ans=set()
 
if A>B:
  print(0)
  sys.exit()
elif N==1:
  if A==B:
    print(1)
    sys.exit()
  else:
    print(0)
    sys.exit()
elif N==2:
  print(1)
  sys.exit()
else:
  for x in itertools.combinations_with_replacement(range(A,B+1),N-2):
    if x in ans:
      continue
    ans.add(sum(x))
 
print(len(ans))

Fixed submission:
N,A,B=map(int,input().split())
 
if N==1:
  if A==B:
    print(1)
  else:
    print(0)
elif A==B:
  print(1)
elif A>B:
  print(0)
else:
  print(B*(N-2)-A*(N-2)+1)

Buggy python submission (verdict: Runtime Error):
import itertools

N,A,B=map(int,input().split())
ans=set()

if A>B:
  print(0)
elif N==1:
  if A==B:
    print(1)
  else:
    print(0)
elif N==2:
  print(1)
else:
  for x in itertools.combinations_with_replacement(range(A,B+1),N-2):
    if x in ans:
      continue
    ans.add(sum(x))

print(len(ans))

Fixed submission:
N,A,B=map(int,input().split())
 
if N==1:
  if A==B:
    print(1)
  else:
    print(0)
elif A==B:
  print(1)
elif A>B:
  print(0)
else:
  print(B*(N-2)-A*(N-2)+1)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
if x>y:
  x,y=y,x

A=[1,3,5,,7,8,10,12]
B=[4,6,9,11]

if x==2 or y==2:
  print('No')
elif (x in A and y in B):
  print('No')
else:
  print('Yes')


Fixed submission:
x,y=map(int,input().split())
 
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]
 
if x==2 or y==2:
  print('No')
elif (x in A and y in A) or (x in B and y in B):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[0]*(N*1)
 
for _ in range(M):
  a,b=map(int,input().split())
  A[a]+=1
  A[b]+=1
 
for i in range(1,N+1):
  print(A[i])

Fixed submission:
N,M=map(int,input().split())
A=[0]*(N+1)
 
for _ in range(M):
  a,b=map(int,input().split())
  A[a]+=1
  A[b]+=1
 
for i in range(1,N+1):
  print(A[i])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[0]*(N*1)

for _ in range(M):
  a,b=map(int,input())
  A[a]+=1
  A[b]+=1

for i in range(1,N+1):
  print(A[i])

Fixed submission:
N,M=map(int,input().split())
A=[0]*(N+1)
 
for _ in range(M):
  a,b=map(int,input().split())
  A[a]+=1
  A[b]+=1
 
for i in range(1,N+1):
  print(A[i])
Buggy python submission (verdict: Runtime Error):
A,B=map(int,iput().split())
 
if A+B>=24:
  print(A+B-24)
else:
  print(A+B)

Fixed submission:
A,B=map(int,input().split())
 
if A+B>=24:
  print(A+B-24)
else:
  print(A+B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,iput().splilt())

if A+B>=24:
  print(A+B-24)
else:
  print(A+B)

Fixed submission:
A,B=map(int,input().split())
 
if A+B>=24:
  print(A+B-24)
else:
  print(A+B)
Buggy python submission (verdict: Runtime Error):
W,a,b=map(int,input())
print(max(max(a,b)-W-min(a,b),0))


Fixed submission:
W,a,b=map(int,input().split())
print(max(max(a,b)-W-min(a,b),0))
Buggy python submission (verdict: Runtime Error):
import bisect

N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()
ans=0
i=0

if T[0]+K>=T[-1]:
  print(1)
else:
  while True:
    if i==N-1:
      ans+=1
      break
    i=bisect.bisect_right(T,T[i]+K)
    print(T,i)
    ans+=1
  print(ans)

Fixed submission:
import bisect
import sys

N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()
ans=0
i=0

if T[0]+K>=T[-1]:
  if N%C==0:
    print(N//C)
  else:
    print(N//C+1)
  sys.exit()
else:
  while True:
    t=bisect.bisect_right(T,T[i]+K)
    if t-i>C:
      i+=C
    else:
      i=t
    ans+=1
    if i==N-1:
      ans+=1
      break
    if i>N-1:
      i=N-1
      break
print(ans)

Buggy python submission (verdict: Runtime Error):
import bisect

N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()
ans=0
i=0

if T[0]+K>=T[-1]:
  print(1)
else:
  while True:
    if i==N-1:
      ans+=1
      break
    i=bisect.bisect_left(T,T[i]+K)
    ans+=1
  print(ans)

Fixed submission:
import bisect
import sys

N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()
ans=0
i=0

if T[0]+K>=T[-1]:
  if N%C==0:
    print(N//C)
  else:
    print(N//C+1)
  sys.exit()
else:
  while True:
    t=bisect.bisect_right(T,T[i]+K)
    if t-i>C:
      i+=C
    else:
      i=t
    ans+=1
    if i==N-1:
      ans+=1
      break
    if i>N-1:
      i=N-1
      break
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
l = np.arange(1,n+1)
print(np.pord(l)%(10**9+7))

Fixed submission:
n = int(input())
ans = 1

for i in range(1, n+1):
  ans *= i
  ans %= 10**9+7

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1, n+1):
  ans *= i
print(ans%(10**9+7))

Fixed submission:
n = int(input())
ans = 1

for i in range(1, n+1):
  ans *= i
  ans %= 10**9+7

print(ans)
Buggy python submission (verdict: Runtime Error):
x=int(inptu())

if x<1200:
  print('ABC')
else:
  print('ARC')

Fixed submission:
x=int(input())
 
if x<1200:
  print('ABC')
else:
  print('ARC')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import itertools
 
k,s = map(int, input().split())
l = np.arange(k+1)
 
p = np.array(list(itertools.product(l,repeat=2)))
p = np.array(s - np.sum(p,axis=1))
p = np.array(p[p>=0])
print(np.count_nonzero(p<=k))

Fixed submission:
k,s = map(int, input().split())
ans = 0

for x in range(k+1):
  for y in range(k+1):
    if 0<=s-x-y and s-x-y <=k:
      ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import itertools

k,s = map(int, input().split())
l = np.arange(k+1)
ans = 0

p = np.array(list(itertools.combinations_with_replacement(l,3)))
p = p[np.sum(p,axis=1)==s]
p = np.array([np.unique(row).size for row in p])

print(np.count_nonzero(p==1)+np.count_nonzero(p==2)*3+np.count_nonzero(p==3)*6)


Fixed submission:
k,s = map(int, input().split())
ans = 0

for x in range(k+1):
  for y in range(k+1):
    if 0<=s-x-y and s-x-y <=k:
      ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import itertools

k,s = map(int, input().split())
l = np.arange(k+1)

p = np.array(list(itertools.product(l,repeat=3)))

print(np.count_nonzero(np.sum(p,axis=1)==s))

Fixed submission:
k,s = map(int, input().split())
ans = 0

for x in range(k+1):
  for y in range(k+1):
    if 0<=s-x-y and s-x-y <=k:
      ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
count = 0


if x < 0:
  abs_x = abs(x)
  count += 1

if y < 0:
  abs_y = abs(y)
  count += 1
count += abs_y - abs_x

if x == y:
  count = 0
print(count)

Fixed submission:
x,y = map(int, input().split())
ans = 0

if (x==0 and y>0) or (y==0 and x<0):
  ans = abs(abs(y)-abs(x))
elif (x==0 and y<0) or (y==0 and x>0):
  ans = abs(abs(y)-abs(x))+1
else:
  ans = abs(abs(y)-abs(x))
  if x>0 and y>0:
    if x>y:
      ans += 2
  elif x>0 and y<0:
    ans += 1
  elif x<0 and y>0:
    ans += 1
  elif x<0 and y<0:
    if x>y:
      ans += 2

print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
T=list(map(int,input().split()))
M=int(input())
ans=sum(T)
for i in range(len(M)):
  P,X=map(int,input().split())
  print(ans-T[P-1]+X)

Fixed submission:
N=int(input())
T=list(map(int,input().split()))
M=int(input())
ans=sum(T)
for i in range(M):
  P,X=map(int,input().split())
  print(ans-T[P-1]+X)
Buggy python submission (verdict: Runtime Error):
S=set(x for x in input())
if len(S)==4:
  print('Yes')
elif lens(S)==2:
  if 'W' in S and 'E' in S:
    print('Yes')
  elif 'N' in S and 'S' in S:
    print('Yes')
  else:
    print('No')
else:
  print('No')  

Fixed submission:
S=set(x for x in input())
if len(S)==4:
  print('Yes')
elif len(S)==2:
  if 'W' in S and 'E' in S:
    print('Yes')
  elif 'N' in S and 'S' in S:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = input()
original_pop_cnt = x.count("1")

pop_cnt_add = original_pop_cnt + 1
pop_cnt_sub = original_pop_cnt - 1

n_after_once_popcount_add = 0
n_after_once_popcount_sub = 0

for i in range(n):
    n_after_once_popcount_add = (n_after_once_popcount_add * 2 + int(x[i])) % pop_cnt_add
    n_after_once_popcount_sub = (n_after_once_popcount_sub * 2 + int(x[i])) % pop_cnt_sub

pow_add = [1] * (n + 100)
pow_sub = [1] * (n + 100)

for i in range(1, n + 100):
    pow_add[i] = (pow_add[i-1]*2) % pop_cnt_add
    pow_sub[i] = (pow_sub[i-1]*2) % pop_cnt_sub

def f(nex):
    ans = 0
    num = nex
    while num != 0:
        num = num % bin(num).count("1")
        ans += 1
    return ans

for i in range(n-1, -1, -1):
    if x[n - 1 - i] == "0":
        nxt = n_after_once_popcount_add
        nxt = nxt + pow_add[i]
        nxt = nxt % pop_cnt_add
        print(f(nxt) + 1)
    if x[n - 1 - i] == "1":
        if pop_cnt_sub != 0:
            nxt = n_after_once_popcount_sub
            nxt = nxt - pow_sub[i]
            nxt = nxt % pop_cnt_sub
            print(f(nxt) + 1)
        else:
            print(0)



            

Fixed submission:
n = int(input())
x = input()
original_pop_cnt = x.count("1")

pop_cnt_add = original_pop_cnt + 1
pop_cnt_sub = original_pop_cnt - 1

n_after_once_popcount_add = 0
n_after_once_popcount_sub = 0

for i in range(n):
    n_after_once_popcount_add = (n_after_once_popcount_add * 2 + int(x[i])) % pop_cnt_add
    if pop_cnt_sub != 0:
        n_after_once_popcount_sub = (n_after_once_popcount_sub * 2 + int(x[i])) % pop_cnt_sub

pow_add = [1] * 250000
pow_sub = [1] * 250000
for i in range(1, n + 100):
    pow_add[i] = (pow_add[i-1]*2) % pop_cnt_add
    if pop_cnt_sub != 0:
        pow_sub[i] = (pow_sub[i-1]*2) % pop_cnt_sub

def f(nex):
    ans = 0
    num = nex
    while num != 0:
        num = num % bin(num).count("1")
        ans += 1
    return ans

for i in range(n-1, -1, -1):
    if x[n - 1 - i] == "0":
        nxt = n_after_once_popcount_add
        nxt = nxt + pow_add[i]
        nxt = nxt % pop_cnt_add
        print(f(nxt) + 1)
    if x[n - 1 - i] == "1":
        if pop_cnt_sub != 0:
            nxt = n_after_once_popcount_sub
            nxt = nxt - pow_sub[i]
            nxt = nxt % pop_cnt_sub
            print(f(nxt) + 1)
        else:
            print(0)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()

remain = [[0,0,0]]
for i in range(n):
    r, g, b = remain[-1]
    if s[-i-1] == "R":
        r = r+1
    elif s[-i-1] == "G":
        g = g + 1
    elif s[-i-1] == "B":
        b = b + 1

    remain.append([r,g,b])

total = 0
for i in range(n-2):
    if s[i] == "R":
        for j in range(i+1, n):
            if s[j] == "G":
                total += remain[-j-1][2]
                if i+((j-i)*2) < n:
                    if s[i+((j-i)*2)]=="B":
                        total -= 1
            elif s[j] == "B":
                total += remain[-j-1][1]
                if i+((j-i)*2) < n:
                    if s[i+((j-i)*2)]=="G":
                        total -= 1
    elif s[i] == "G":
        for j in range(i+1, n):
            if s[j] == "B":
                total += remain[-j-1][0]
                if i+((j-i)*2) < n:
                    if s[i+((j-i)*2)]=="R":
                        total -= 1
            elif s[j] == "R":
                total += remain[-j-1][2]
                if i+((j-i)*2) < n:
                    if s[i+((j-i)*2)]=="B":
                        total -= 1
    elif s[i] == "B":
        for j in range(i+1, n):

            if s[j] == "R":
                total += remain[-j-1][1]
                if i+((j-i)*2) < n:
                    if s[i+((j-i)*2)]=="G":
                        total -= 1
            elif s[j] == "G":
                total += remain[-j-1][0]
                if i+((j-i)*2) < n:
                    if s[i+((j-i)*2)]=="R":
                        total -= 1
print(total)

Fixed submission:
n,k = map(int,input().split())
gcds = []


def power_func(a,n,p):
    bi=str(format(n,"b"))#2進表現に
    res=1
    for i in range(len(bi)):
        res=(res*res) %p
        if bi[i]=="1":
            res=(res*a) %p
    return res

mod = 10**9+7
for i in range(k):
    div = k//(k-i)
    count = power_func(div,n, mod)
    for j in range(1,div):
        count = count - gcds[k-((k-i)*(j+1))]
    gcds.append(count)

total = 0

for i in range(k):
    total = (total + (gcds[i]*(k-i)%mod))%mod
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s_list = []
for _ in range(n):
    s_list.append(input())
s_list.sort()
dic = sorted(set(s_list), key=s_list.index)
max_count=0
ans = []
for d in dic:
    coun = s_list.count(d)
    if max_count < coun:
        ans = [d]
        max_count = coun
    elif max_count == coun:
        ans.append(d)
    else:
        pass


for a in ans:
    print(a)

Fixed submission:
n=int(input())
s_dic = {}
for _ in range(n):
    s = input()
    if s in s_dic:
        s_dic[s] = s_dic[s] + 1
    else:
        s_dic[s] = 1

max_val = max(s_dic.values())
for s in sorted(s_dic):
    if s_dic[s] == max_val:
        print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p_list = list(map(int,input().split()))
max_idx = 0
max_val = 0
for i in range(n-k+1):
    total = sum(p_list[i:i+k])
    if total > max_val:
        max_val = total
        max_idx = i

def exp(n):
    return 1+(n-1)*0.5

print(sum(map(exp, p_list[max_idx:max_idx+k])))

Fixed submission:
n, k = map(int, input().split())
p_list = list(map(int,input().split()))

from collections import deque
d=deque(p_list[:k])
max_val = sum(p_list[:k])
total = max_val
max_idx = 0

for i in range(k, n):
    num = p_list[i]
    total = total + num - d.popleft()
    if total > max_val:
        max_val = total
        max_idx = i-k+1
    d.append(num)

def exp(n):
    return 1+(n-1)*0.5

print(sum(map(exp, p_list[max_idx:max_idx+k])))
Buggy python submission (verdict: Runtime Error):
n = int(input())

count = 0
for i in range(n):
    if i4 % 2 == 0:
        count = count + 1
print(count/n)

Fixed submission:
n = int(input())

count = 0
for i in range(n):
    if i % 2 == 0:
        count = count + 1
print(count/n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int,input().split()))
b_list = [0]*(n-n//2)+a_list[(n-n//2):]

for i in range(n//2+1):
    k = int(n//2-i-1)
    if a_list[k] != sum(b_list[k::k+1])%2:
        b_list[k] = 1

b_list = [i+1 for i,x in enumerate(b_list) if x ==1]
x = len(b_list)
print(x)
if x != 0:
    print(*b_list)

Fixed submission:
r = int(input())


print(3*r**2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = list(map(int,input().split()))
b_list = []

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

for i in range(n):
    if a_list[-i-1] == 1:
        b_list.append(n-i)
        for j in make_divisors(n-i):
            a_list[j-1] = abs(a_list[j-1]-1)

b_list.reverse()
x = len(b_list)
print(x)
if x != 0:
    print(*b_list)

Fixed submission:
n = int(input())
a_list = list(map(int,input().split()))
b_list = [0]*(n)

for i in range(n):
    k = int(n-i-1)
    if a_list[k] != sum(b_list[k::k+1])%2:
        b_list[k] = 1

b_list = [i+1 for i,x in enumerate(b_list) if x ==1]
x = len(b_list)
print(x)
if x != 0:
    print(*b_list)
Buggy python submission (verdict: Runtime Error):
l, r = map(int,input().split())

lmod=l%2019
rmod=r%2019

if r-l>=2019:
    print(0)
elif l <= 2019*(r//2019):
    print(0)
else:
    mini = 10**9
    for i in range(lmod,rmod+1):
        for j in range(i+1,rmod+1):
            mini = min(mini,(i*j)%2019)
print(mini)

Fixed submission:
l, r = map(int,input().split())

lmod=l%2019
rmod=r%2019

if r-l>=2019:
    mini = 0
elif l <= 2019*(r//2019):
    mini = 0
else:
    mini = 10**9
    for i in range(lmod,rmod+1):
        for j in range(i+1,rmod+1):
            mini = min(mini,(i*j)%2019)
print(mini)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
amini = a.index(min(a))
a = a[amini:]+a[:amini]


for i in range(a[0]+1):
    b = [i*2]
    for j in range(1,n):
        c = a[j-1]*2-b[-1]
        if not (c<0):
            b.append(c)
        else:
            break
    if len(b)==n and (b[0]+b[-1] == a[-1]*2):
        b = b[-amini:]+b[:-amini]
        print(*b)
        exit(0)

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

suma = sum(a)
suma2 = sum([a[x] for x in range(1,n,2)])
b = [suma-suma2*2]
for i in range(1,n):
    b.append(a[i-1]*2-b[i-1])
print(*b)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
lists = []
limit = []
cost = []
for i in range(n):
    a, b = (map(int,input().split()))
    lists.append([a,b,True])


def dfs(que, sum_cost, in_list):
    if que == n:
        print('Yes')
        exit(0)
    for i in range(n):
        if lists[i][2]:
            sum_cost_out = sum_cost + lists[i][0]
            if sum_cost_out <= lists[i][1]:
                out_list = in_list[:]
                out_list[i][2] = False
                dfs(que+1,sum_cost_out,out_list)


dfs(0,0,lists)
print('No')

Fixed submission:
n = int(input())
lists = []
limit = []
cost = [0 for _ in range(n)]
for i in range(n):
    a, b = (map(int,input().split()))
    lists.append([a,b])

lists.sort(key = lambda x:x[1])
sum_ = 0
for i in range(n):
    sum_ = sum_ + lists[i][0]
    if sum_ <= lists[i][1]:
        continue
    else:
        print('No')
        exit(0)
print('Yes')

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

n = int(input())
lists = []
limit = []
cost = []
for i in range(n):
    a, b = (map(int,input().split()))
    lists.append([a,b,True])

lists.sort(key=lambda x:x[1])

def dfs(que, sum_cost, in_list):
    if que == n:
        print('Yes')
        exit(0)
    for i in range(n):
        if lists[i][2]:
            sum_cost_out = sum_cost + lists[i][0]
            if sum_cost_out <= lists[i][1]:
                out_list = in_list[:]
                out_list[i][2] = False
                dfs(que+1,sum_cost_out,out_list)

dfs(0,0,lists)
print('No')

Fixed submission:
n = int(input())
lists = []
limit = []
cost = [0 for _ in range(n)]
for i in range(n):
    a, b = (map(int,input().split()))
    lists.append([a,b])

lists.sort(key = lambda x:x[1])
sum_ = 0
for i in range(n):
    sum_ = sum_ + lists[i][0]
    if sum_ <= lists[i][1]:
        continue
    else:
        print('No')
        exit(0)
print('Yes')
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input())
print((A*3+B)//2)

Fixed submission:
A, B = map(int,input().split())
print((A*3+B)//2)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
S = input()
S[k-1] = S[k-1].lower()
print(S)

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

Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
S = input()
S[k-1] = S[k-1].lower
print(S)

Fixed submission:
n, k = map(int,input().split())
S = input()
S = S[:k-1] + S[k-1].lower() + S[k:]
print(S)
Buggy python submission (verdict: Runtime Error):
char = input()
if chara == 'A':
  print('T')
elif chara == 'T':
  print('A')
elif chara == 'C':
  print('G')
elif chara == 'G':
  print('C')

Fixed submission:
chara = input()
if chara == 'A':
  print('T')
elif chara == 'T':
  print('A')
elif chara == 'C':
  print('G')
elif chara == 'G':
  print('C')
Buggy python submission (verdict: Time Limit Exceeded):

def count(char):
  l, r = map(int, input().split())
  char1 = char[l-1:r]
  char1 = char1.split('AC')
  print(len(char1)-1)

N, Q = map(int, input().split())
char = input()

for i in range(Q):
  count(char)

Fixed submission:
N, Q = map(int, input().split())
char = input()
num_list = [0]
for i in range(1,N):
  if char[i-1:i+1] == 'AC':
    num_list.append(num_list[-1]+1)
  else:
    num_list.append(num_list[-1])

for i in range(Q):
  l,r=map(int, input().split())
  print(num_list[r-1]-num_list[l-1])