TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
import heapq

q=int(input())
a=[]
heapq.heapify(a)
sum_b=0
for _ in range(q):
    qi=list(map(int,input().split()))
    if qi[0]==1:
        heapq.heappush(a,qi[1])
        sum_b+=qi[2]
    else:
        m=a[len(a)//2]
        print(m,sum_b+sum(abs(x-m) for x in a))


from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]
dij=[(1,0),(-1,0),(0,1),(0,-1)]

def main():
    sa = sb = 0
    hp1 = []
    hp2 = []
    m = None
    for _ in range(II()):
        ab=input().split()
        if ab[0]=="1":
            a,b=int(ab[1]),int(ab[2])
            sb+=b
            heappush(hp1,-a)
            heappush(hp2,a)
            while -hp1[0]>hp2[0]:
                heappush(hp1,-heappop(hp2))
                heappush(hp2,-heappop(hp1))
            if m==None:
                m=a
                continue
            if -hp1[0]>m:
                d=-hp1[0]-m
                sa+=(len(hp1)-1)//2*d-(len(hp2)+1)//2*d
            if -hp1[0]<m:
                d=hp1[0]+m
                sa+=-(len(hp1))//2*d+(len(hp2))//2*d
            sa += abs(m - a)
            m=-hp1[0]
        else:
            print(m,sa+sb)

main()

Verdicts: Wrong Answer

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
n=int(input())
y=[]
x=0
for i in range(n):
    I=input()
    if I[0]==str(1):
        a,b,c=map(int,I.split())
        x=(x+b)/2
        y.append(c)
    else:
        x=int(x)
        if len(y)>1:
            print(int(x),sum(abs(i-x) for i in y[:-1])-c)
        else:
            print(b,y[0])
        

from heapq import*

class median_tree(object):
    def __init__(self):
        self.lower_than_med=[]
        self.higher_than_med=[]
        self.count=0
        self.low=0
        self.high=0
        self.median=0
    def push(self,x):
        self.count=1-self.count
        if self.count:
            y=heappushpop(self.higher_than_med,x)
            heappush(self.lower_than_med,-y)
            self.low +=-y
            self.high+=x-y
        else:
            y=heappushpop(self.lower_than_med,-x)
            heappush(self.higher_than_med,-y)
            self.low -=x+y
            self.high-=y
        self.median=-self.lower_than_med[0]

from heapq import*
n=int(input())
m=median_tree()

B=0
for i in range(n):
    I=input()
    if I[0]=="1":
        a,b,c=map(int,I.split())
        B+=c
        m.push(b)
    else:
        print(m.median,m.count%2*m.median+B+m.low+m.high)


Verdicts: Wrong Answer

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
import heapq

Q = int(input())
q = [list(map(int, input().split())) for _ in range(Q)]


ql = []
qr = []

push = heapq.heappush
pop = heapq.heappop

push(qr, 10000000000)
push(ql, -10000000000)
a = 0
m = q[0][1]
b = q[0][2]
l = q[0][1]
r = q[0][1]
for i in q[1:]:
  if i[0] == 1:
    b += i[2]
    if i[1] < l:
      a += abs(i[1] - l)
    elif r < i[1]:
      a += abs(i[1] - r)
    if len(ql) <= len(qr):
      v = [m, pop(qr), i[1]]
    else:
      v = [m, -pop(ql), i[1]]
    v.sort()
    ll = v[0]
    m = v[1]
    rr = v[2]
    
    push(ql, -ll)
    push(qr, rr)
    if len(ql) <= len(qr):
      l = ll
      r = m
    else:
      l = m
      r = m

  else:
    print(l, a + b)
    

import heapq

Q = int(input())
q = [list(map(int, input().split())) for _ in range(Q)]


ql = []
qr = []

push = heapq.heappush
pop = heapq.heappop

push(qr, 10000000000)
push(ql, -10000000000)
a = 0
m = q[0][1]
b = q[0][2]
l = q[0][1]
r = q[0][1]
for i in q[1:]:
  if i[0] == 1:
    b += i[2]
    if i[1] < l:
      a += abs(i[1] - l)
    elif r < i[1]:
      a += abs(i[1] - r)
    if len(ql) <= len(qr):
      v = [m, pop(qr), i[1]]
    else:
      v = [m, -pop(ql), i[1]]
    v.sort()
    ll = v[0]
    m = v[1]
    rr = v[2]
    if len(ql) <= len(qr):
      l = ll
      r = m
    else:
      l = m
      r = m

    push(ql, -ll)
    push(qr, rr)
  else:
    print(l, a + b)
    

Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
import heapq

L = []
R = []
pop = heapq.heappop
push = heapq.heappush
A, B, C = 0, 0, 0

def nasu(a):
  global A
  global C
  if len(R) == 0:
    push(R, a)
    C = a
    return
  if len(L) == 0:
    r = pop(R)
    push(L, -min(a, r))
    push(R, max(a, r))
    A += abs(a - r)
    C = min(a, r)
    return
  if len(L) < len(R):
    r = pop(R)
    l = -pop(L)
    push(L, -l)
    push(L, -min(a, r))
    push(R, max(a, r))
    A += abs(a - r)
    if a < l:
      C = l
    elif a < r:
      C = a
    return
  l = -pop(L)
  r = pop(R)
  if l <= a and a <= r:
    push(L, -l)
    push(R, r)
    push(R, a)
    C = a
  elif a < l:
    push(L, -a)
    push(R, r)
    push(R, l)
    A += abs(a - l)
    C = l
  else:
    push(L, -l)
    push(R, a)
    push(R, r)
    A += abs(a - r)
    C = r

for q in Query:
  if q[0] == 1:
    nasu(q[1])
    B += q[2]
  if q[0] == 2:
    print(C, A + B)
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
from heapq import*
L,R=[]*2
B=t=0
Q,*E=open(0)
for e in E:
	if' 'in e:_,a,b=map(int,e.split());t=1-t;a*=2*t-1;c=heappushpop([L,R][t],a);heappush([R,L][t],-c);B+=b+a-c-c
	else:print(-L[0],B-L[0]*t)

from heapq import*
L,R=[],[]
B=t=0
Q,*E=open(0)
for e in E:
	if' 'in e:_,a,b=map(int,e.split());t^=1;a*=2*t-1;c=heappushpop([L,R][t],a);heappush([R,L][t],-c);B+=b+a-c-c
	else:print(-L[0],B-L[0]*t)

Verdicts: Runtime Error

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
from heapq import heappop, heappush, heappushpop

n = int(input())
q = [tuple(int(x) for x in input().split()) for _ in range(n)]

L = []
R = []
a = 1
b = q[0][2]

heappush(L, -q[0][1])

for i in range(1, n):
    temp = q[i]
    if temp[0] == 1:
        a += 1
        if a % 2 == 0:
            p = heappushpop(L, - temp[1])
            heappush(R, - p)
        else:
            p = heappushpop(R, temp[1])
            heappush(L, - p)
        b += temp[2]
    else:
        m = - L[0]
        
        print(m, 0)


from heapq import heappop, heappush, heappushpop

n = int(input())
q = [tuple(int(x) for x in input().split()) for _ in range(n)]

L = []
R = []
a = 1
b = q[0][2]

ans = 0

heappush(L, -q[0][1])

for i in range(1, n):
    temp = q[i]
    if temp[0] == 1:
        a += 1
        if a % 2 == 0:
            ans += abs(temp[1] + L[0])
            p = heappushpop(L, - temp[1])
            heappush(R, - p)
        else:
            ans += abs(temp[1] + L[0])
            tl = L[0]
            p = heappushpop(R, temp[1])
            heappush(L, - p)
            if tl != L[0]:
                ans -= abs(tl - L[0])
        b += temp[2]
    else:
        m = - L[0]
        print(m, ans + b)


Verdicts: Wrong Answer

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
import bisect
import sys
input = sys.stdin.readline
q=int(input())
A=[]
b=0
def f(A,b,n):
  res=0
  if n%2==0:
    return sum(A[n+1:])-sum(A[:n])+b
  else:
    return sum(A[n:])-sum(A[:n])+b
for _ in range(q):
  L=[int(i) for i in input().split()]
  if L[0]==1:
    n=bisect.bisect_left(A,L[1])
    A.insert(n,L[1])
    b+=L[2]
  else:
    n=A[(len(A)-1)//2]
    print(n,f(A,b,n))

from heapq import heappop
from heapq import heappush
q=int(input())
L,R=[],[]
b_sum=0
l_sum,r_sum=0,0
count=0
mid=0
for _ in range(q):
  
  Q=list(map(int,input().split()))
  if Q[0]==1:
    a,b=Q[1],Q[2]
    count+=1
    b_sum+=b
    if count==1:
      mid=a
    elif count%2==0:
      if a<=mid:
        heappush(L,-a)
        l_sum+=a
        heappush(R,mid)
        r_sum+=mid
      else:
        heappush(L,-mid)
        l_sum+=mid
        heappush(R,a)
        r_sum+=a
    else:
      l,r=-heappop(L),heappop(R)
      if a<l:
        heappush(L,-a)
        l_sum+=a-l
        mid=l
        heappush(R,r)
      elif r<a:
        heappush(L,-l)
        mid=r
        heappush(R,a)
        r_sum+=a-r
      else:
        heappush(L,-l)
        mid=a
        heappush(R,r)

  else:
    if count%2==1:
      print(mid,r_sum-l_sum+b_sum)
    else:
      l=-heappop(L)
      print(l,r_sum-l_sum+b_sum)
      heappush(L,-l)




Verdicts: Wrong Answer

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
import numpy as np

num_q = int(input())
x = 0
f = 0
a = []
c = False
b = 0

for b in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    a.append(n)
    a.sort()
    x_tmp = a[b//2]
    if c:
      f += m + np.abs(x - n)
    else:
      f += m + np.abs(x_tmp - n)
    c = ~c
    x = x_tmp
    b += 1


import numpy as np

num_q = int(input())
x = 0
f = 0
a = []
c = False

for i in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    a.append(n)
    a.sort()
    x_tmp = a[(i+1)//2]
    if c:
      f += m + np.abs(x - n)
    else:
      f += m + np.abs(x_tmp - n)
    c = ~c
    x = x_tmp


from heapq import heappush, heappop

num_q = int(input())
x = 0
f = 0
low = []
high = []
odd = False
num_a = 0
 
for _ in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    if odd:
      if n >= -low[0]:
        f += m + n + low[0]
        heappush(high, n)
      else:
        f += m - n - low[0]
        heappush(low, -n)
        heappush(high, -heappop(low))
    else:
      f += m
      if num_a == 0:
        heappush(low, -n)
      else:
        if n > -low[0]:
          if n > high[0]:
            f += n - high[0]
          heappush(high, n)
          heappush(low, -heappop(high))
        else:
          f += - n - low[0]
          heappush(low, -n)

    odd = ~odd
    x = -low[0]
    num_a += 1

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There is a function f(x), which is initially a constant function f(x) = 0.  We will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:    * An update query `1 a b`: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).   * An evaluation query `2`: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.  We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.

Submission attempts (in order):
Q=int(input())
q,a,b,fx,x=[],[],0,0,0
for i in range(Q):
  q.append(list(map(int,input().split())))
  if q[i][0]==2:
    fx+=b
    print(x,fx)
  else:
    a.append(q[i][1])
    b+=q[i][2]
    n=len(a)
    na=a[-1]
    if n%2==0:
      r=a[n//2-1]
      a.sort()
      if na<r:
        x=a[n//2-1]
        fx+=x-na
      elif na==r:
        x=a[n//2-1]
      else:
        x=r
        fx+=na-r
    else:
      r=[a[n//2-1],a[n//2]]
      a.sort()
      if na<r[0]:
        x=a[n//2-1]
        fx+=r[0]-na
      elif r[0]<=na<=r[1]:
        x=r[0]
        fx+=na-r[0]
      else:
        x=a[n//2]
        fx+=na-x

import heapq
q=int(input())
L=[]
R=[]
heapq.heapify(L)
heapq.heapify(R)
fx=0
for i in range(q):
  Q=list(map(int,input().split()))
  if Q[0]==1:
    a,b=Q[1],Q[2]
    heapq.heappush(L,-a)
    heapq.heappush(R,a)
    l=-heapq.heappop(L)
    r=heapq.heappop(R)
    if l==a and r==a:
      heapq.heappush(L,-l)
      heapq.heappush(R,r)
    else:
      fx+=abs(r-l)
      heapq.heappush(L,-r)
      heapq.heappush(R,l)
    x=-L[0]
    fx+=b
  else:
    print(x,fx)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
s[k-1]=s[k-1].lower()
print(s)


n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print(s)


n,k=map(int,input().split())
s=input()
s[k-1]=s[k-1].lower()
print("".join(s))


n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print("".join(s))


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
S = str(input())
print(S[k-1].lower())

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

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K =map(int, input().split())
S = input()
S=list(S)
S[K] = S[K].lower()
print("".join(S))


N, K =map(int, input().split())
S = input()
S=list(S)
S[K-1] = S[K-1].lower()
print("".join(S))


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K=map(int,input().split())
S = input()
 
S = list(s)
S[K - 1] = s[K - 1].lower()
S = "".join(S)
print(S)


S = int(input())
a = S % 100
b = (S- (S % 100))/100
if   b <= 12 and  a<=12 and a!=0 and b!= 0:
       print("AMBIGUOUS")
elif b <= 12 and a!=0 :
       print("MMYY")
elif a<=12 and a!=0  :
       print("YYMM")
else :
      print("NA")

n,k=map(int,input().split())
a = input()
 
a = list(a)
a[k - 1] = a[k-1].lower()
a = "".join(a)
print(a)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
a,b=map(int,input().split())
s=input()
print(s.replace(s[b-1],lower(s[b-1])))

a,s=map(int,input().split())
k=input()
lk=list(k)
l=lk[s-1]
lk[s-1]=l.lower()
print(str(lk))

a,s=map(int,input().split())
k=input()
lk=list(k)
l=lk[s-1]
lk[s-1]=l.lower()
print("".join(lk))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
word_S = input().split(" ")[-1]
S = list(word_S)
change_K = int(input())
word1 = ""
for i in range(change_K - 1):
    word1 = word1 + S[i]
word2 = S[change_K - 1]
word3 = ""
count = 0
while True:
    try:
        word3 = word3 + S[change_K + count]
        count += 1
    except IndexError:
        break
word2 = word2.swapcase()
print(word1+word2+word3)


change_K = int(input().split(" ")[-1])
word_S = list(input())
S = list(word_S)
word1 = ""
for i in range(change_K - 1):
    word1 = word1 + S[i]
word2 = S[change_K - 1]
word3 = ""
count = 0
while True:
    try:
        word3 = word3 + S[change_K + count]
        count += 1
    except IndexError:
        break
word2 = word2.swapcase()
print(word1 + word2 + word3)


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=input().split()
s=[]
s=list(input())
k=int(k)

s[k-1]=s[k-1].lower()
print(s)
ans="".join(s)
print(ans)

n,k=input().split()
s=[]
s=list(input())
k=int(k)

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

ans="".join(s)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
if 1 <= s1 <= 12 and 1 <= s2 <= 12:
    print("AMBIGUOUS")
elif 1 <= s1 <= 12:
    print("MMYY")
elif 1 <= s2 <= 12:
    print("YYMM")
else:
    print("NA")

N,K = map(int, input().split())
S = input()
S_list =list(S)
l ={"A":"a","B":"b","C":"c"}
ans=S_list[K-1]
S_list[K-1]=l[ans]
print("".join(S_list))


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, read().split())
s = read()
k -= 1
s= s[:k] + str.lower(s[k]) + s[k+1:]
print(s)

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

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):



n, k = map(int, input().split())
s = input()

# dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]



print(s[:k-1] + s[k-i].lower() + s[k:])




    n, k = map(int, input().split())
    s = input()

    
    print(s[:k-1] + s[k-1].lower() + s[k:])





n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]



# print(s[:k-1] + s[k-i].lower() + s[k-1:])


print(s[:k-1] + dic.get(s[k-1]) + s[k-1:])

    
    

    n, k = map(int, input().split())
    s = input()

    #dic = {"A":"a", "B":"b", "C":"c"}

    
    # s[k-1]


    
    print(s[:k-1] + s[k-1].lower() + s[k:])

    
    




n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]


print(s[:k] + dic.get(s[k-1]) + s[k-1:])




n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]


# print(s[:k] + )


print(s[:k-1] + dic.get("{s[k-1]}") + s[k-1:])

    
    

    n, k = map(int, input().split())
    s = input()

    #dic = {"A":"a", "B":"b", "C":"c"}

    
    # s[k-1]


    
    print(s[:k-1] + s[k-1].lower() + s[k-1:])

    
    




n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]



# print(s[:k-1] + s[k-i].lower() + s[k-1:])


print(s[:k-1] + dic.get(s[k-1]) + s[k-1:])




n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]



print(s[:k-1] + s[k-i].lower() + s[k-1:])




    
    

    n, k = map(int, input().split())
    s = input()

    dic = {"A":"a", "B":"b", "C":"c"}

    
    # s[k-1]


    
    print(s[:k-1] + s[k-i].lower() + s[k-1:])

    
    

    
    

    n, k = map(int, input().split())
    s = input()

    # dic = {"A":"a", "B":"b", "C":"c"}

    
    # s[k-1]


    
    print(s[:k-1] + s[k-i].lower() + s[k:])

    
    




n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]


# print(s[:k] + )


print(s[:k-1] + dic.get("s[k-1]") + s[k-1:])

    
    

    n, k = map(int, input().split())
    s = input()

    # dic = {"A":"a", "B":"b", "C":"c"}

    
    # s[k-1]


    
    print(s[:k-1] + s[k-i].lower() + s[k-1:])

    
    




n, k = map(int, input().split())
s = input()

dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]


print(s[:k-1] + dic.get(s[k-1]) + s[k-1:])




n, k = map(int, input().split())
s = input()

# dic = {"A":"a", "B":"b", "C":"c"}


# s[k-1]



print(s[:k-1] + s[k-1].lower() + s[k:])




Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int, input().split())
s = list(input())

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

print("".join(s))

n,k = map(int, input().split())
s = list(input())

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

print("".join(s))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
#YYMM or MMYY or AMBIGUOUS or NA

inputLine = input()

firstPart = int(inputLine[0:2])
secondPart = int(inputLine[2:4])


naFlag = False
firstPartYear = False
firstPartAmb = False
secondPartYear = False
secondPartAmb = False


if firstPart < 0:
    naFlag = True

elif firstPart == 0:
    firstPartYear = True
    
elif firstPart < 13:
    firstPartAmb = True
    
else: 
    firstPartYear = True
    

if secondPart < 0:
    naFlag = True

elif secondPart == 0:
    secondPartYear = True
    
elif secondPart < 13:
    secondPartAmb = True
    
else: 
    secondPartYear = True
    
if naFlag:
    print('NA')

elif secondPartYear:
    if firstPartYear:
        print('NA')
    elif firstPartAmb:
        print('MMYY')

elif secondPartAmb:
    if firstPartYear:
        print('YYMM')
    elif firstPartAmb:
        print('AMBIGUOUS')
  

firstLine = input()


N = int(firstLine.split()[0])

K = int(firstLine.split()[1]) - 1


S = list(input())

if S[K] == 'A' or S[K] == 'B' or S[K] == 'C':
    S[K] = S[K].lower()
else:
    S[K] = S[K].upper()

print(''.join(S))

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
import sys

stdin = sys.stdin

ni = lambda: int(ns()) #int
na = lambda: list(map(int, stdin.readline().split())) #int,list
ns = lambda: stdin.readline().rstrip()  # str

n,k = na()
s=ns()
print(s.replace(s[k+1],s[k+1].lower()))

import sys

stdin = sys.stdin

ni = lambda: int(ns()) #int
na = lambda: list(map(int, stdin.readline().split())) #int,list
ns = lambda: stdin.readline().rstrip()  # str

n,k = na()
s=ns()
print(s[:k-1]+s[k-1].lower()+s[k:])

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
s=input()
a=int(s[:2])
b=int(s[2:])
if 1<=a<=12 and 1<=b<=12:
	print("AMBIGUOUS")
elif 1<=a<=12 and (12<b or b==0):
	print("MMYY")
elif (12<a or a==0) and 1<=b<=12:
	print("YYMM")
else:
	print("NA")

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

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = input()
upper = {
    'A': 'a',
    'B': 'b',
    'C': 'c',
}
print(s[:k] + upper[s[k]] + s[k+1:])

n, k = map(int, input().split())
s = input()
upper = {
    'A': 'a',
    'B': 'b',
    'C': 'c',
}
print(s[:k-1] + upper[s[k-1]] + s[k:])

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K=map(int, input().split())
S= input()
T=''
for i in range (K):
    if i ==K-1:
        T += S[i].lower()
    else:
        T += S[i]
print(T)

N, K = map(int, input().split())
S = input()
S[K - 1] = S[k - 1].lower()
print(S)

N, K=map(int, input().split())
S= input()
T=''
for i in range (N):
    if i ==K-1:
        T += S[i].lower()
    else:
        T += S[i]
print(T)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):

def main():
    N, K = map(int, [int(x) for x in input().split()])
    S = input()

    ans = ""
    for i, n in enumerate(S):
        if i == K-1:
            n = n.lower()
        ans += n

    return ans


if __name__ == "__main__":
    main()



def main():
    N, K = map(int, [int(x) for x in input().split()])
    S = input()

    ans = ""
    for i, n in enumerate(S):
        if i == K-1:
            n = n.lower()
        ans += n
    print(ans)
    return ans


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
print(s[k-1].lower())

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


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int,input().split())
s = input()

s.replace(s[k-1],s[k-1].lower())
print(s)

n,k = map(int,input().split())
s = input()

s.replace(s[k-1],s[k-1].lower())

n,k = map(int,input().split())
s = input()

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

print(s[:k-1]+s0+s[k:])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n = input()

n1 = int(n[:2])
n2 = int(n[2:])

def date(n1, n2):
    if n1 >= 13 and n2 == 0:
        return 'NA'
    if n1 <= 12 and n2 == 0:
        return 'MMYY'
    if n1 >= 13 and n2 >= 13:
        return 'NA'
    if n1 >= 13 and n2 <= 12:
        return 'YYMM'
    if n1 <= 12 and n2 >= 13:
        return 'MMYY'
    if n1 <= 12 and n2 <= 12:
        return 'AMBIGUOUS'


print(date(n1, n2))

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

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
A,B=map(int,input().split())
C=input()
print(C[:B]+C[B].lower()+C[B+1:])

A,B=map(int,input().split())
C=input()
print(C[:B-1]+C[B-1].lower()+C[B:])

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
    # encoding:utf-8
    import copy
    import random
    import bisect 
    import fractions 
    import math
     
    mod = 10**9+7
     
    N,K = map(int,input().split())
    S = str(input())
     
    replace = S[K-1]
    replace = replace.lower()
     
    print(S[:K-1]+replace+S[K:])

# encoding:utf-8
import copy
import random
import bisect 
import fractions 
import math

mod = 10**9+7

N,K = map(int,input().split())
S = str(input())

replace = S[K-1]
replace = replace.lower()

print(S[:K-1]+replace+S[K:])


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K =  map(int,input().split())
S = input()
SL = list(S)

SL[K] = SL[K].lower()
answer = "".join(SL)
print(answer)

N,K =  map(int,input().split())
S = input()
SL = list(S)

SL[K] = SL[K].lower()
answer = "".join(SL)
print(answer)

N,K =  map(int,input().split())
S = input()
SL = list(S)
 
SL[K - 1] = SL[K - 1].lower()
answer = "".join(SL)
print(answer)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
k+=1
s=s[:k]+s[k].lower()+s[k+1:]
print(s)

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

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
S = input()

if S[0:2] == "00" or S[2:4] == "00":
    print("NA")
    
elif S[2:4] > "12" and S[0:2] > "12":
    print("NA")
    
elif S[0:2] > "12" and  S[2:4] <= "12":
    print("YYMM")
    
elif S[2:4] > "12":
    print("MMYY")
    
elif S[0:2] < "12":
    print("AMBIGUOUS")
    
elif S[0:2] == "12" and S[2:4] == "12":
    print("AMBIGUOUS")
    
    

S = input()

if S[0:2] == "00" or S[2:4] == "00":
    print("NA")
    
elif S[2:4] > "12" and S[0:2] > "12":
    print("NA")
    
elif S[0:2] > "12" and  S[2:4] <= "12":
    print("YYMM")
    
elif S[2:4] > "12":
    print("MMYY")
    
elif S[0:2] < "12":
    print("AMBIGUOUS")

elif S[0:2] == "12" and S[2:4] < "12":
    print("AMBIGUOUS")
     
elif S[0:2] == "12" and S[2:4] == "12":
    print("AMBIGUOUS")
    
    

N, K = map(int, input().split())
S = list(input())
ans = ""

S[K-1] = S[K-1].lower()
print(ans.join(S))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n , k = map(int, input().split())
s = list(input())
for i in range(n):
  if (i - 1) == k:
  	s[i] = s[i].lower()
print("".join(s))

n , k = map(int, input().split())
s = list(input())
for i in range(n):
  if i == k:
  	s[i] = s[i].lower
print("".join(s))

n , k = map(int, input().split())
s = list(input())
for i in range(n):
  if i == (k - 1):
  	s[i] = s[i].lower()
print("".join(s))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K = map(int,input().split())
S = input()

S[K-1]=S[k-1].lower()
print(S)

N,K = map(int,input().split())
S = list(input())
 
S[K-1]=S[K-1].lower()
print("".join(S))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int, input().split())
w = {"A":"a", "B":"b", "C":"c"}
s = input().split()
print([i if i != k-1 else w[s[i]] for i in len(s)])

n,k = map(int, input().split())
w = {"A":"a", "B":"b", "C":"c"}
s = list(input())
print(''.join([w[s[i]] if i == k-1 else s[i] for i in range(n)]))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int,input().split())
S = input()

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

print(r)

N, K = map(int,input().split())
S = input()
K = K - 1
r = S[:K]
r = r + S[K].lower()
r = r + S[K+1:]
 
print(r)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
import math
n,k = map(int, input().split())
res = float(0)
for i in range(1, n+1):
    res += float(1/n) * pow(1/2, math.ceil(math.log2(k) - math.log2(i)))
print(res)


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

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
# -*- coding:utf-8 -*-

n, k = map(int,input().split())
s = list(input())

for i in range(n):
    if i == k:
        print(s[i].lower(), end="")
    else:
        print(s[i], end="")
print("")

#!/bin/usr/python3
# -*- coding: utf-8 -*-

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

S[K] = S[K].lower()
S_out = "".join(S)
print(S_out)

#!/bin/usr/python3
# -*- coding: utf-8 -*-

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

S[K-1] = S[K-1].lower()
S_out = "".join(S)
print(S_out)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = input()

print(s.replace(s[k-1], s[k-1].upper()))


n, k = map(int, input().split())
s = input()

print(s.replace(s[k], s[k].lower()))


n, k = map(int, input().split())
s = input()

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

print("".join(s))

n, k = map(int, input().split())
s = input()

print(s.replace(s[n-1], s[n-1].upper()))


n,k = map(int,input().split())
s = list(input())

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

print(''.join(s))


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int, input().split())
s = input()
s[k-1].lower()
print(s)

n,k = map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print(''.join(s))

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
S = input()
X = int(S[0:2])
Y = int(S[2:4])

if X > 12 and Y > 12:
    print("NA")
elif X == 0 or Y == 0:
    if X == 0:
        if Y > 12:
            print("NA")
        else:
            print("YYMM")
    else:
        if X > 12:
            print("NA")
        else:
            print("MMYY")
elif X < 13 and Y < 13:
    print("AMBIGUOUS")
elif X > Y:
    print("YYMM")
else:
    print("MMYY")


N,K = map(int,input().split())
S =  input()
ans = ""

for i in range(N):
    if i+1 == K:
        ans += S[i].lower()
    else:
        ans += S[i]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):


import os
import sys

N, K = map(lambda x: int(x), input().split(" "))
S = input()

S = S[0:K] + S[K].lower() + S[K+1:len(S)]

print(S)






import os
import sys

N, K = map(lambda x: int(x), input().split(" "))
S = input()

S = S[0:K] + S[K].lower() + S[K+1:len(S)]

print(S)






import os
import sys

N, K = map(lambda x: int(x), input().split(" "))
S = input()

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

print(S)




Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int. input().split())
s = input()

change = s[k-1].lower()
print(s[:k] + change + s[k+1:])


n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print(''.join(s))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int, input().split())
S = input()
S[K-1] += 32
print(S)

N, K = list(map(int, input().split()))
S = input()
print(S[:K-1]+S[K-1].lower()+S[K:])

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
def main():
    S = input()
    first = int(S[0:2])
    last = int(S[2:4])

    if(first>12 and last<=12):
        print("YYMM")
    elif(last>12 and first<=12):
        print("MMYY")
    elif(last<=12 and first<=12):
        print("AMBIGUOUS")
    else:
        print("NA")
    
    return
main()


def main():
    N,K = map(int, input().split())
    S = input()
    out_str = ""
    for i in range(N):
        if i==K-1:
            out_str+=S[i].lower()
        else:
            out_str+=S[i]
    print(out_str)
main()

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K=map(int,input().split())
S=input()
new_S= S.lower(K)
print(new_S)

N,K = list(map(int,input().split()))
S = input()
print(S[:K-1]+S[K-1].lower()+S[K:])


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K = map(int,input().split())
S = list(map(int,input().split()))

s = S(K)
s_large = s.upper()

S = [s_large if s=S(K) else 0 for s in S]

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

#print(N,K,S)

s = S[K-1]
#print(s)
s_large = s.lower()
#print(s_large)

S[K-1] = s_large
print(''.join(S))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int, input().split())
S = str(input())

if S[N-1]=="A":
    after="a"
elif S[N-1]=="B":
    after="b"
else:
    after="c"
str_changed = S[:K-1] + after + S[K:]
print(str_changed)

N, K = map(int, input().split())
S = str(input())

if S[K-1]=="A":
    after="a"
elif S[K-1]=="B":
    after="b"
else:
    after="c"
str_changed = S[:K-1] + after + S[K:]
print(str_changed)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int, input().split())
S = input()
s = S[K - 1]
S = list(S)
S[K - 1] = str.lower(s)
S = str(S)

print(S)

N, K = map(int, input().split())
S = input()
s = S[K - 1]
S = list(S)
S[K - 1] = str.lower(s)
S = "".join(S)
 
print(S)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
x = input()

a, b = x.split()
a = list(a)
b = int(b)

a[b] = a[b].lower()

print("".join(a))



x = input()
s = input()

n, k = x.split()
k = int(k)
s = list(s)

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

print("".join(s))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, m = input().split()
N = int(n)
K = int(m)

S = input()

string = list(S)

string[K+1] = string[K+1].lower()

print(''.join(string))


n, m = input().split()
N = int(n)
K = int(m)

S = input()

string = list(S)

string[K-1] = string[K-1].lower()

print(''.join(string))


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
print(s[:k]+s[k].lower()+s[k+1:])

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

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
a, b = list(map(int,input().split()))
S = list(str(input()))
S[a+1] = str.lower(S[a+1])
S = "".join(map(str,S))
print(S)

a, b = list(map(int,input().split()))
S = list(str(input()))
S[a-1] = str.lower(S[a-1])
S = "".join(map(str,S))
print(S)

a, b = list(map(int,input().split()))
S = list(str(input()))
S[b-1] = str.lower(S[b-1])
S = "".join(map(str,S))
print(S)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K=map(int,input().split())
S=list(input())
S=S[0:K-1].append(S[K-1].lower)+S[K-1:]

N,K=map(int,input().split())
S=input()
print(S[0:K-1]+S[K-1].lower()+S[K:])

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = list(input())
s[k] = s[k].lower()
print("".join(s))


n, k = map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int, input().split())
s = input()

s_temp = s.swapcase()

ans = s[:k]+s_temp[k]+s[k+1:]

print(ans)


n,k = map(int, input().split())
s = input()

s_temp = s.swapcase()

ans = s[:k-1]+s_temp[k-1]+s[k:]

print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int,input().split())
s = input()
s[k-1] = s[k-1].lower()
print(s)

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted