TnT/Multi_CodeNet4Repair huggingface dataset:
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

S = int(input())

first_half = math.floor(S / 100)
second_half = S - first_half * 100

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
  elif 0 == first_half or 12 < first_half :
    	print("NA")
  else: 
        print("MMYY")

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

letters = list(S)
letters[K] = letters[K].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

import math
 
S = int(input())
 
first_half = math.floor(S / 100)
second_half = S - first_half * 100
 
if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
elif 1 <= second_half <= 12 :
   		print("YYMM")
elif 1 <= first_half <= 12 :
    	print("MMYY")
else: 
        print("NA")

S = int(input())

first_half = round(S, -2) / 100
second_half = S - round(S, -2)

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
  elif 1 <= first_half <= 12 :
    	print("MMYY")
  else: 
        print("NA")

import math

S = int(input())

first_half = math.floor(S / 100)
second_half = S - math.floor(S / 100) * 100

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
  elif 0 == first_half or 12 < first_half :
    	print("NA")
  else: 
        print("MMYY")

S = int(input())

first_half = round(S, -2) / 100
second_half = S - round(S, -2)

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
elif 1 <= second_half <= 12 :
    print("YYMM")
elif 1 <= first_half <= 12 :
    print("MMYY")
else: 
    print("NA")

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

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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()
answer = []

print(s[k-1].lower())
for i, c in enumerate(s, 1):
    if i == k:
        answer.append(c.lower())
    else:
        answer.append(c)
print("".join(answer))

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

for i, c in enumerate(s, 1):
    if i == k:
        answer.append(c.lower())
    else:
        answer.append(c)
print("".join(answer))

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 = list(map(int, input().split()))
S = int(input())

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

print(S)

N, K = input().split()
K = int(K)
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 = list(map(int, input().split()))
s = input()
s[k - 1] = (s[k - 1]).lower()
print(s)

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

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

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


Verdicts: 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()
t = s[k-1]
ans = s[:k-1] + t.lower() + s[k:]


n, k = map(int, input().split())
s = input()
t = s[k-1]
ans = s[:k-1] + t.lower() + s[k:]
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):
k = int(input().split()[1])
s = input()
print(s[0:k]+s[k:k+1].lower()+s[k+1:len(s)+1])

k = int(input().split()[1])
s = input()
print(s[0:k-1]+s[k-1:k].lower()+s[k:len(s)+1])

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):
def get_s(w, e):
    s = w + 1
    if s == k:
        if e == "A":
            return "a"
        elif e == "B":
            return "b"
        else:
            return "c"
    else:
        return e


i = list(map(int, input().split()))

k = i[1]


a = list(input())


ab = 0

while ab < i[0]:

    a[ab] = get_s(ab, a[ab])
    ab += 1

print(i)
print(a)


def get_s(w, e):
    s = w + 1
    if s == k:
        if e == "A":
            return "a"
        elif e == "B":
            return "b"
        else:
            return "c"
    else:
        return e


i = list(map(int, input().split()))

k = i[1]


a = list(input())


ab = 0

while ab < i[0]:

    a[ab] = get_s(ab, a[ab])
    ab += 1

print(i)
print(a)



def get_s(w, e):
    s = w + 1
    if s == k:
        if e == "A":
            return "a"
        elif e == "B":
            return "b"
        else:
            return "c"
    else:
        return e


i = list(map(int, input().split()))

k = i[1]


a = list(input())


ab = 0

while ab < i[0]:

    a[ab] = get_s(ab, a[ab])
    ab += 1

p = ""


for d in range(i[0]):
    p += a[d]
 
print(p)


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):
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

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')

S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
elif S1 == '00': 
	print('YYMM')
elif: S2 == '00':
	print('MMYY')
else:
	print('NA')

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

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

print(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

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-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: 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=input().split()
a=list(map(int,a))
ini=a[0]
obj=a[1]
poss=0
i=1
divini=1
pot=0
posini=i/ini
while i<=ini:
  pot=0
  divini=i
  while divini<obj:
    divini=divini*2
    pot+=1
  i=i+1
  poss=poss+(posini*((1/2)**pot))
print(poss)

a=input()
i=0
n=[]
while i<len(a):
  n.append(a[i])
  i+=1
pd=n[0]+n[1]
sd=n[2]+n[3]
pd=int(pd)
sd=int(sd)
if sd==0 and pd==0:
  print('NA')
elif pd>12:
  if sd>=1 and sd<=12:
    print('YYMM')
  elif sd>12:
    print('NA')
  elif sd<1:
    print('NA')
elif pd==0:
  if sd>12:
    print('NA')
  if sd>0 and sd<=12:
    print('YYMM')
elif pd<=12:
  if sd>12:
    print ('MMYY')
  elif sd==0:
    print('MMYY')
  elif sd<=12 and sd!=0:
    print('AMBIGUOUS')

a=input().split()
a=list(map(int,a))
pos = a[1]-1
pal=input()
pal=list(pal)
pal[pos]=pal[pos].lower()
i=1
while i<a[0]:
  pal[0]=pal[0]+pal[i]
  i+=1
print (pal[0])

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[1:K] + {'A': 'a', 'B': 'b', 'C': 'c'}[S[K]] + (S[K+1:] if K+1 < N else ''))

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

print(S[:K] + {'A': 'a', 'B': 'b', 'C': 'c'}[S[K]] + (S[K+1:] if K+1 < N else ''))


N, K = map(int, input().split())
S = input()
K -= 1
print(S[:K] + {'A': 'a', 'B': 'b', 'C': 'c'}[S[K]] + (S[K+1:] if K+1 < N else ''))


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 = int(input())
K = int(input())
S = input()
s1 = S[:K - 1]
s2 = S[K:]

if S[K - 1] == 'A':
    s = s1 + 'a' + s2

elif S[K - 1] == 'B':
    s = s1 + 'b' + s2

else:
    s = s1 + 'c' + s2

print(s)


N = int(input())
K = int(input())
S = input()

if S[K - 1] == 'A':
  s = S.replace('A', 'a')

elif S[K - 1] == 'B':
  s = S.replace('B', 'b')

else:
  s = S.replace('C', 'c')

print(s)


N = input()
K = input()
S = input()

if S[K - 1] == 'A':
  s = S.replace('A', 'a')

elif S[K - 1] == 'B':
  s = S.replace('B', 'b')

else:
  s = S.replace('C', 'c')

print(s)


N = int(input())
K = int(input())
S = input()
s1 = S[:K - 1]
s2 = S[K + 1:]

if S[K - 1] == 'A':
    s = s1 + 'a' + s2

elif S[K - 1] == 'B':
    s = s1 + 'b' + s2

else:
    s = s1 + 'c' + s2

print(s)


import fileinput

if __name__ == '__main__':
  for line in fileinput.input():
    tokens = list(map(int, line.strip().split()))
    N, K, S = tokens[0], tokens[1], tokens[2]


if S[K - 1] == 'A':
  s = S.replace('A', 'a')

elif S[K - 1] == 'B':
  s = S.replace('B', 'b')

else:
  s = S.replace('C', 'c')

print(s)


nums = input().split()
N = int(nums[0])
K = int(nums[1])
S = input()

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

print(s)


Verdicts: Runtime Error

Runtime Error

Runtime Error

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=str(input())
if s[k-1]=="A":
  s[k-1]=="a"
elif s[k-1]=="B":
  s[k-1]=="b"
else:
  s[k-1]="c"
print(s)

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 = int(input())
graph = [[] for _ in range(N)]

for i in range(N-1):
    u, v, w = map(int, input().split())
    graph[u-1].append((v-1, w))
    graph[v-1].append((u-1, w))

# print(graph)

flag = [None for _ in range(N)]  


def k(v, distance):  
    flag[v] = distance  

    for next_v, w in graph[v]:
        if flag[next_v] == 1 or flag[next_v] == 0:  
            continue
        if (w % 2) == 0:  
            k(next_v, distance)
        else:
            k(next_v, 1-distance)


k(0, 0)  
for i in range(N):
    print(int(flag[i]))


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

S_list = list(S)

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

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, input().split())
s3 =[]

s = list(input())

s1 = s


s2= s1[K]

s3 = s2.lower()

s1[K] = s3

print('' .join(s1))


N, K = map(int, input().split())
s3 =[]

s = list(input())

s1 = s


s2= s1[K-1]

s3 = s2.lower()

s1[K-1] = s3

print('' .join(s1))

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=tuple(map(int,input().split()))
print(n,k)
s=list(input())
s[k-1]=s[k-1].lower()
print("".join(s))

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

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


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

Verdicts: Wrong Answer

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):
import sys


def main():

    N, K = [int(x) for x in sys.stdin.readline().rstrip().split()]
    S = list(sys.stdin.readline().rstrip())

    S_new = []
    for i, s in enumerate(S):
        if i + 1 == K:
            s = s.lower()
        S_new.append(s)

    print(S_new)


if __name__ == "__main__":
    main()

import sys


def main():

    N, K = [int(x) for x in sys.stdin.readline().rstrip().split()]
    S = list(sys.stdin.readline().rstrip())

    S_new = []
    for i, s in enumerate(S):
        if i + 1 == K:
            s = s.lower()
        S_new.append(s)

    print("".join(S_new))


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 = list(input())

if n == 1:
    print(s.lower())
    break
else:
    l = []
    for x in s:
        if x == s[k - 1]:
            l.append(x.lower())
        else:
            l.append(x)
    a = ''.join(l)
    print(a)

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

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

x = ''.join(s)
print(x)

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())
S.replace(S[K-1], S[K-1].lower())
print(S)

N, K = map(int, input().split())
S = str(input())
ans = ""
for i in range(N):
    if i == K-1:
        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):
N, K = (int(x) for x in input().split())
S = input()

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

N, K = (int(x) for x in input().split())
S = input()

S = S[:K-1] +S[K-1].lower() +S[K:]
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):
N,K = map(int,input().split())
S = list(input())
print(S)
if S[K-1] == 'A':
  S[K-1] = 'a'
elif S[K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(''.join(S))

N,K = map(int,input().split())
S = list(input())
print(S)
if S[K-1] == 'A':
  S[K-1] = 'a'
elif S[K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(''.join(S))

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

if S[K-1] == 'A':
  S[K-1] = 'a'
elif S[K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(''.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 = int(input())
K = int(input())
S = str(input())

s_up = list(S)
s_low = s_up[K-1].lower()
s_up [K-1] = s_low

for n in range(N):
    print(s_up[n], end='')

print()


l = input().split()
N = int(l[0])
K = int(l[1])
S = str(input())

s_up = list(S)
s_up [K-1] = s_up[K-1].lower()

for n in range(N):
    print(s_up[n], end='')

print()

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 checkMM(i):
    if i >= 1 and i <= 12:
        result = 1
    else:
        result = 0
    return result

def checkYY(i):
    if i >= 0 and i <= 99:
        result = 1
    else:
        result = 0
    return result


s = input()

s1 = int(s[:2])
s2 = int(s[2:])

result = 'NA'

if checkMM(s1) and checkYY(s2):
    result = 'MMYY'


if checkYY(s1) and checkMM(s2):
    if result == 'MMYY':
        result = 'AMBIGUOUS'
    else:
        result = 'YYMM'

print(result)

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

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

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):
(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):
small = ['a', 'b', 'c']
capital = ['A', 'B', 'C']

tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
str = input()

str[K] = small[capital.index(str[K])]

print(str)

small = ['a', 'b', 'c']
capital = ['A', 'B', 'C']
 
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
str = list(input())
 
str[K - 1] = small[capital.index(str[K - 1])]
 
print("".join(str))

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())
l=[i for i in str(input())]

l[k]=l[k].lower()

print(''.join(l))

n,k=map(int,input().split())
l=[i for i in str(input())]

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

print(''.join(l))

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-1]=s[k-1].lower()
print(s)

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

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

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:])

Verdicts: Wrong Answer

Wrong Answer

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 = [int(x) for x in input().split()]
S = list(input())


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


answer = ''.join(replace)

print(answer)

N,K = [int(x) for x in input().split()]
S = list(input())


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


answer = ''.join(S)

print(answer)


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=[int(i) for i in input().split()]
c=list(input())

c[b] = str.lower(c[b])

c = ''.join(c)

print(c)

a,b=[int(i) for i in input().split()]
c=list(input())

c[b-1] = str.lower(c[b-1])

c = ''.join(c)

print(c)

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().split())

print(join(s[k-1].swapcase()))

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

print(s[k-1].swapcase)

s = list(input())
s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]

zero = int('{0:02d}'.format(0))

if zero <= s[0] <= 12:
  if zero <= s[1] <= 12:
    print("AMIGUOUS")
  else:
    print("MMYY")
else:
  if zero <= s[1] <= 12:
    print("YYMM")
  else:
    print("NA")

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

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

Verdicts: Runtime Error

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 = list(input())
if s[k-1] == A:
  s[k-1] = a
elif s[k-1] == B:
  s[k-1] = b
else:
  s[k-1] = c
print("".join(s))


n, k = map(int, input().split())
s = list(input())
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
else:
  s[k-1] = "c"
print("".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=(int(i) for i in input().split())
S=input()
print(S[:K]+lower(S[K+1])+S[K+1:])

N,K=(int(i) for i in input().split())
S=input()
print(S[:K]+S[K+1].lower()+S[K+1:])

N,K=(int(i) for i in input().split())
S=input()
print(S[:K-1]+S[K-1].lower()+S[K:])

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=str(input())
A=''

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

print(A)

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

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

print(A)

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

s = input()

former = int(s[:2])
latter = int(s[2:])

##YYMM
if ((former > 12) and (latter <= 12 and latter > 0)):
    print('YYMM')
    sys.exit()

##MMYY
if ((former <= 12 and former > 0) and (latter > 12)):
    print('MMYY')
    sys.exit()

##AMBIGUOUS
if ((former <= 12) and (latter <= 12)):
    print('AMBIGUOUS')
    sys.exit()

##NA
print('NA')

import sys

s = input()

former = int(s[:2])
latter = int(s[2:])

##YYMM
if ((former > 12) and (latter <= 12 and latter > 0)):
    print('YYMM')
    sys.exit()

##MMYY
if ((former <= 12 and former > 0) and (latter > 12)):
    print('MMYY')
    sys.exit()

##AMBIGUOUS
if ((former <= 12 and former > 0) and (latter <= 12 and latter > 0)):
    print('AMBIGUOUS')
    sys.exit()

##NA
print('NA')

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

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

s = "".join(s_list)

print(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 = input()

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


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

SA = ''.join(S_new)
print(SA)

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):
import sys

def countTotalBits(num):

     # convert number into it's binary and
     
     binary = bin(num)[2:]
     return(len(binary))

lines = sys.stdin.readlines()
sides = int((lines[0].rstrip()).split()[0])
K = int((lines[0].rstrip()).split()[1])
base_win = 0
lucky_win = 0
if K == 1:
    print(1)
else:
    K_bits = countTotalBits(K)
    i = 0
    j = 0
    if K <= sides:
        base_win = (1 / sides) * (sides - K + 1)
        while 2**i < K:
            if i == 0:
                count = 1
            else:
                count = 2**i - 2**(i - 1)
            lucky_win += count * (1 / sides) * ((1 / 2) ** (K_bits - i))
            i += 1
        lucky_win += (K - 2**(i - 1)) * (1 / sides) * ((1 / 2) ** (K_bits - i))

    else:
        while 2**i < sides:
            if i == 0:
                count = 1
            else:
                count = 2**i - 2**(i - 1)
            lucky_win += count * (1 / sides) * ((1 / 2) ** (K_bits - i))
            i += 1
        lucky_win += (sides - 2**(i - 1)) * (1 / sides) * ((1 / 2) ** (K_bits - i))

    print(base_win + lucky_win)

import sys

lines = sys.stdin.readlines()
pointer = int((lines[0].rstrip()).split()[1]) - 1
string_list = list(lines[1].rstrip())
string_list[pointer] = string_list[pointer].lower()
output = "".join(string_list)
print(output)

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()
x = s[k-1]
if x == "A":
  s[k-1] = "a"
elif x == "B":
  s[k-1] = "b"
else:
  s[k-1] = "c"
print(s)

n, k =map(int,input().split())
s = input()
x = s[k-1]
if x == "A":
  t = s[:k-1] + "a" + s[k:]
elif x == "B":
  t = s[:k-1] + "b" + s[k:]
else:
  t = s[:k-1] + "c" + s[k:]
print(t)

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()))
c=input().split()
d=c[b].swapecase()
c[b]=d
print(c)


a,b=list(map(int,input().split()))
c=list(input())
d=c[b-1].swapcase()
c[b]=d
c=''.join(c)
print(c)

a,b=list(map(int,input().split()))
c=list(input())
d=c[b-1].swapcase()
c[b-1]=d
c=''.join(c)
print(c)

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):
# -*- coding: utf-8 -*-
n,k=map(int,input().split(" "))
s=input()
s[k-1].lower()
print(s)

# -*- coding: utf-8 -*-
n,k=map(int,input().split(" "))
s=input()
s=s[:k-1]+s[k-1].lower()+s[k]
print(s)

# -*- coding: utf-8 -*-
n,k=map(int,input().split(" "))
s=input()
s=s[:k-1]+s[k-1].lower()+s[k:]
print(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())
print("A" * (k - 1) + "a" + "A" * (n - k))

n, k = map(int, input().split())
s = input()
print(s[:k - 1] + str.lower(s[k - 1]) + 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()
print(S[:k-1]+S[k-1].lower()+S[k:])

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):
import math
N,K = map(int,input().split())


print(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)]))

N,K=map(int,input().split())
S = list(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: 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 = list(input())
ans = S
ans[K-1] = ans[K-1].lower()
print(ans)

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

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

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

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

Verdicts: Wrong Answer

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 = input()

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

print(ans)

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

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

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):
A=list(map(int,input().split()))
S=input().split('')

S(A(1)-1).lower()
print(''.join(S))


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

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

A=list(map(int,input().split()))
S=input()
 
S(A(1)-1).lower()
print(S)

ソースコード 

Copy
Copy
A=list(map(int,input().split()))
S=input()
S=S[0:(A[1]-1)]+S[A[1]-1].lower()+S[(A[1]+1):A[0]]
print(S)

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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()

S[K] = S[K].lower()

print(S)

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

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
replaced_S = S[:K] + S[K].lower() + S[K+1:]

print(replaced_S)

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

S = input()

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

print(replaced_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()
print(s[:k]+s.[k]lower()+s[k+1:])


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]+lower(s[k])+s[k+1:])


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

print(S[:K] + lower(S[K]) + 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

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 = 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

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
import numpy as np
import math
def main():
  input = sys.stdin.readline
  N, K =map(int,input().split())
  p = []
  for d in range(1,N+1):
    if d >= K:
      p.append(1/N)
    else:
      n = math.floor(np.log2(K/d)) + 1
      p.append( 1/N * 1/2 ** n)
  print(sum(p))
main()	

import sys
import numpy as np

def main():
  input = sys.stdin.readline
  N, K = map(int, input().split())
  INF = N * K
  dp = input().strip()
  text =""
  for i in range(N):
    if i == K-1:
      text = text + dp[i].lower()
    else:
      text = text + dp[i]
  print(text)
  
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()
s[k-1]=s[k-1].lower()

print(s)

n,k=map(int,input().split())
s=input()
print(s[:k-1]+str.lower(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()
tmp = ord(s[k])
tmp1 = (chr(tmp+32))
ans = []

for i in range(len(s)):
    if i == k:
        ans.append(tmp1)
    else:
        ans.append(s[i])

print("".join(map(str, ans)))

n, k = map(int, input().split())
s = input()
tmp = ord(s[k-1])
tmp1 = (chr(tmp+32))
ans = []

for i in range(len(s)):
    if i == k-1:
        ans.append(tmp1)
    else:
        ans.append(s[i])

print("".join(map(str, 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):
import numpy as np
import fractions
 
S = input()
F = int(S[0:2])
E = int(S[2:4])
if(F==0 or E==0 or (F>13 and E>13)):
    print("NA")
elif(F<13 and E<13):
    print("AMBIGUOUS")
elif(F<13 and E>13):
    print("MMYY")
elif(F>13 and E<13):
    print("YYMM")

import numpy as np
import fractions

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

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

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):
s = list(input())

t = input()

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

s = input().split()
t = input()
k = int(s[1]) - 1

print(t[:k] + t[k].lower() + t[k+1:])

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):
,K = (int(x) for x in input().split())
S = input()
if N <= 50:
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

N,K = int(input('N = ')), int(input('K = '))
S = input('S = ')

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

Out = S[:K-1] + komoji + S[K:N+1]

print(Out)

N,K = int(input()), int(input())
S = input()

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

Out = S[:K-1] + komoji + S[K:N+1]

print(Out)

N,K = int(input()), int(input())
S = input()
if N <= 50:
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

N,K = (int(x) for x in input().split())
S = input()
if 1 <= N <= 50 and 1 <=K <= N and len(S) == N :
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)


Verdicts: Runtime Error

Runtime Error

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())
txt = input()
txt[b] = txt[b].lower()
print(txt)


a,b = map(int,input().split())
txt = input()
txt[b] = txt[b].lower
print(txt)

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

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()
s = s[:k-1]+str(s[k]).lower()+s[k+1:]
print(s)


n,k=map(int,input().split())
s=input()
k=k-1
s = s[:k]+str(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):
N, K = map(int, input().split())
S = list(map(str, input()))

if S[K] == 'A':
    S[K] = 'a'
elif S[K] == 'B':
    S[K] = 'b'
else:
    S[K] = 'c'
    
T = ''.join(S)

print(T)

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

if S[K] == 'A':
    S[K] = 'a'
elif S[K] == 'B':
    S[K] = 'b'
else:
    S[K] = 'c'

print(S)

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

if S[K-1] == 'A':
    S[K-1] = 'a'
elif S[K-1] == 'B':
    S[K-1] = 'b'
else:
    S[K-1] = 'c'
    
T = ''.join(S)

print(T)

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()
for i,m in enumerate(S):
    if m=="A":
        S[i]="A"
    if m=="B":
        S[i]="B"
    if m=="C"
        S[i]="C"
print(S)


S=input()
if S[0:2]=="00" and int(S[2:4])>=13\
 or S[2:4]=="00" and int(S[0:2])>=13\
 or int(S[0:2])>=13 and int(S[2:4])>=13\
 or S[0:2]=="00" and S[2:4]=="00":
    print("NA")
elif int(S[0:2])>=13:
    print("YYMM")
elif int(S[2:4])>=13:
    print("MMYY")
else:
    print("AMBIGUOUS")


N,K=map(int,input().split())
S=input()
for i,m in enumerate(S):
    if m=="A":
        S[i]="A"
    if m=="B":
        S[i]="B"
    if m=="C":
        S[i]="C"
print(S)


N,K=map(int,input().split())
S=input()
S=[i for i in S]
for i,m in enumerate(S):
    if m=="A":
        S[i]="A"
    if m=="B":
        S[i]="B"
    if m=="C":
        S[i]="C"
#S="".join(S)
SS=""
for i in S:
    SS+=i
print(SS)


N,K=map(int,input().split())
S=input()
SS=""
for i,s in enumerate(S):
    if i==K-1:
        if s=="A":
            s="a"
        if s=="B":
            s="b"
        if s=="C":
            s="c"
    SS+=s
print(SS)


Verdicts: Runtime Error

Wrong Answer

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):
s = input()
a = int(s[0:2])
b = int(s[2:4])

if 1 <= a <= 12 and 1 <= b <= 12:
    print("AMBIGUOUS")
elif (a == 0 or 12 < a < 100) and (b == 0 or 12 < b < 100):
    print("NA")
elif (a == 0 or 12 < a < 100) and 1 <= b <= 12:
    print("YYMM")
else:
    print("MMYY")


a=list(map(int, input().split()))
s = input()
s_list=list(s)

index = a[1] - 1
temp= s[index].lower()
s_list[index] = temp
s = "".join(s_list)
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):
_, K = map(int, input().split())
S = input()
S[:K-1] + S[K-1].lower() + S[K:]

_, 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):
#d-even relation


n=int(input())
visitedlist=[-1 for  i in range(n)]
lists=[tuple(map(int,input().split())) for i in range(n-1)]
kilist=[[] for i in range(n)]
for i in lists:
    kilist[i[0]-1].append(i[1:])
    kilist[i[1]-1].append(i[0:3:2])
visitedlist[0]=1
anslist=[0 for i in range(n)]


def search(i):
        flag=False
        for j in kilist[i-1]:
            if visitedlist[j[0]-1]<0:
                visitedlist[j[0]-1]=1
                flag=True
                if j[1]%2==0:
                    anslist[j[0]-1]=anslist[i-1]
                elif j[1]%2!=0:
                    anslist[j[0]-1]=1-anslist[i-1]      
            else:
                pass  
        if flag:    
            for j in kilist[i-1]:
                return search(j[0])
        if not flag:
            pass
            
search(1)
for k in anslist:
    print(k)


import sys
sys.setrecursionlimit(80000)

n=int(input())
visitedlist=[-1 for  i in range(n)]
kilist=[[] for i in range(n)]
anslist=[0 for i in range(n)]
searchedlist=[-1 for i in range(n)]
for i in range(n-1):
        a,b,c=map(int,input().split())
        kilist[a-1].append((b,c))
        kilist[b-1].append((a,c))
def search(i):
        searchedlist[i-1]=1
        visitedlist[i-1]=1
        flag=0
        for j in kilist[i-1]:
            if visitedlist[j[0]-1]<0:
                visitedlist[j[0]-1]=1
                flag+=1
                anslist[j[0]-1]=anslist[i-1]+j[1]
        else:
            pass

        if flag>0:    
            for k in kilist[i-1]:
                if searchedlist[k[0]-1]==-1:
                    search(k[0])
search(2)
for i in anslist:
    print(i%2)


n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print("".join(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):
m,k = map(int, input().split())

def check_xor(m):
    c = 0
    for x in range(2**m):
        if x ^ x == k:
            c += 1
        else:
            break
            
    if c == 2**m:
        return True
    
    else:
        return False

if check_xor(m) and k<2**m:
    L = ''.join([str(i)*2 for i in range(2**m)])
    print(' '.join(L))
else:
    print('-1')

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

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):
4 3
CABA

a,b=map(int,input().split())
b=b-1
s=input()
print(s[0:b].upper()+s[b].lower()+s[b+1:].upper())

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 = int(input())

n1 = int(N / 100 % 100)
n2 = N % 100

if n1 == 0 or n2 == 0:
    print("NA")
elif n1 > 12:
    print("YYMM")
elif n2 > 12:
    print("MMYY")
elif n1 < 12:
    print("AMBIGUOUS")


N = int(input())

n1 = int(N / 100 % 100)
n2 = N % 100

if n1 > 12 and n2 > 0:
    print("YYMM")
elif n2 > 12 and n1 > 0:
    print("MMYY")
elif n1 < 13 and n2 < 13:
    print("AMBIGUOUS")
else:
    print("NA")


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

for i in range(len(S)):
    if i == k - 1:
        print(S[i].swapcase(), end="")
    else:
        print(S[i], end="")
print()


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):
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 (b ==0 or b>=13):
	print("MMYY")
elif (a == 0 or a>=13) and  1<=b<=12:
	print("YYMM")
else:
	print("NA")

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 (b ==00 or b>=13):
	print("MMYY")
elif (a == 00 or a>=13) and  1<=b<=12:
	print("YYMM")
else:
	print("NA")

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 (b ==0 or b>=13):
	print("MMYY")
elif (a == 0 and a>=13) and  1<=b<=12:
	print("YYMM")
else:
	print("NA")

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted