Problem:


Score : 100 points

Problem Statement

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.

Constraints

1 ≤ N ≤ 50

1 ≤ K ≤ N

S is a string of length N consisting of A, B and C.

Input

Input is given from Standard Input in the following format:

N K
S

Output

Print the string S after lowercasing the K-th character in it.

Sample Input 1

3 1
ABC

Sample Output 1

aBC

Sample Input 2

4 3
CABA

Sample Output 2

CAbA



Sample input:
3 1
ABC


Sample output:
aBC

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
s = input()
result = ''
for i in range(n):
  if i == k-1:
    result += s[i].tolower()
  else:
    result += s[i]
print(result)

Submission status: Runtime Error

Solution code:


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

s = S[k-1]
if s == "A" :
	S[k-1] = "a"
elif s == "B" :
	s[k-1] = "b"
else :
	s[k-1] = "c"

print("".join(S))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#coding utf-8
import sys

# f = open('test.txt', 'r')
# input = f.read().split('\n')
# header = input[0]
# char = input[1]
# header_length, header_num = header.split(' ')

header_length = sys.argv[1]
header_num = sys.argv[2]
char = sys.argv[3]

# print(header_length)
# print(header_num)

count = 0
ans = []

for i in char:
    count += 1
    ans.append(i)
    if count == int(header_num):
        ans[count-1] = ans[count-1].lower()

ans = ''.join(ans)

print(ans)

Submission status: Runtime Error

Solution code:
#coding utf-8
import sys

f = open(sys.argv[1], 'r')
input = f.read().split('\n')

header = input[0]
char = input[1]

header_length, header_num = header.split(' ')

# print(header_length)
# print(header_num)

count = 0
ans = []

for i in char:
    count += 1
    ans.append(i)
    if count == int(header_num):
        ans[count-1] = ans[count-1].lower()

ans = ''.join(ans)

print(ans)

Submission status: Runtime Error

Solution code:
#coding utf-8
import sys

f = open('test.txt', 'r')
input = f.read().split('\n')

header = input[0]
char = input[1]

header_length, header_num = header.split(' ')

# print(header_length)
# print(header_num)

count = 0
ans = []

for i in char:
    count += 1
    ans.append(i)
    if count == int(header_num):
        ans[count-1] = ans[count-1].lower()

ans = ''.join(ans)

print(ans)

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
using namespace std;
int MOD = 1000000007;

signed main(){
    int n,k;
    string s;
    cin >> n >> k >> s;
    s[k-1] = 'a' -  'A' + s[k-1];
    cout << s << endl;
    
    
    return 0; 
}

// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://cf17-final-open.contest.atcoder.jp/tasks/cf17_final_a
// rm -r -f test;oj dl http://abc126.contest.atcoder.jp/tasks/abc126_a

Submission status: Runtime Error

Solution code:
N = int(input())
weights = [input() for _ in range(N-1)]
weights = [x.split() for x in weights]
weights = [list(map(int,x)) for x in weights]

color = [1 for _ in range(N+1)]
color[1] = 0
bi = []
if N > 2:
    for i in range(1,N+1):
        n1 = None
        n2 = None
        l1 = 0
        l2 = 0
        for x in weights:
            if x[0]==i:
                if n1 == None:
                    n1 = x[1]
                    l1 = x[2]
                else:
                    n2 = x[1]
                    l2 = x[2]
            if x[1]==i:
                if n1 == None:
                    n1 = x[1]
                    l1 = x[2]
                else:
                    n2 = x[1]
                    l2 = x[2]
        if n1 != None and n2 != None:
            bi.append([n1,n2,l1+l2])   
w2 = weights + bi
for _ in range(N):
    c = 0
    for x in w2:
        if x[2]%2 == 0:
            if color[x[0]] == 0 and color[x[1]] == 1 and  x[2]%2 == 0:
                color[x[1]] = color[x[0]]
                c = 1
            if color[x[1]] == 0 and color[x[0]] == 1 and  x[2]%2 == 0:
                color[x[0]] = color[x[1]]
                c = 1
    if c == 0:
        break
for x in color[1:]:
    print(x)

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = list(input())

a[m] = a[m].replace("A","a").replace("B","b").replace("C","c")
print("".join(a))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = list(input())

a[m] = a[m].remove("A","a").remove("B","b").remove("C","c")
print("".join(a))

Submission status: Runtime Error

Solution code:
import math

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

proba = 0

for i in range(1, k):
  n_coin = int(math.log(k/i,2)) + 1
  print(i, n_coin)
  proba += float(1)/n*((0.5)**n_coin)

if n >= k:
	proba += float(n-k+1)/n

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

Submission status: Runtime Error

Solution code:
n, k = [int(e) for e in input().split()]
s = input()
s[k] = s[k].lower()
print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
edges = [list(map(int, input().split())) for i in range(n-1) ]

# -1 -> Black, 1 -> white, 0 -> not yet
memo = [0 for i in range(n)]
memo[0] = 1

# print("memo", memo)

def paint(index, node_num):
  for edge in edges:
    if (edge[0]==node_num):
      if (edge[2] % 2 == 0):
        # print("edge", edge)
        memo[edge[1]-1] = memo[i]
        edges.remove(edge)
        paint(edge[1]-1, edge[1])
      else:
        # print("edge", edge)
        memo[edge[1]-1] = -memo[i]
        edges.remove(edge)
        paint(edge[1]-1, edge[1])
    if (edge[1]==node_num):
      if (edge[2] % 2 == 0):
        # print("edge", edge)
        memo[edge[0]-1] = memo[i]
        edges.remove(edge)
        paint(edge[0]-1, edge[1])
      else:
        # print("edge", edge)
        memo[edge[0]-1] = -memo[i]
        edges.remove(edge)
        paint(edge[0]-1, edge[1])


for i in range(n):
  if (memo[i] != 0):
    continue
  memo[i] = 1
  node_num = i + 1
  # print("node_num", node_num)
  # print("=======================")
  paint(i, node_num)
  # print("memo", memo)
  # print("=======================")

# print("memo", memo)

for item in memo:
  if (item == 1):
    print("1")
  else:
    print("0")

Submission status: Runtime Error

Solution code:
    N,K = map(int,input().split())
    line = list(input())
    line[K-1] = line[K-1].lower()
    print(str(line))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
line = list(input())
line[K+1] = line[K+1].lower()
print(str(line))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
edges = [[] for _ in range(n + 1)]
for _ in range(n - 1):
	u, v, w = list(map(int, input().split()))
	edges[u].append([v, w % 2])
	edges[v].append([u, w % 2])


bw = [-1 for i in range(n + 1)]
bw[1] = 0

def dfs(frm):
	for ne in edges[frm]:
		if bw[ne[0]] >= 0:
			continue
		else:
			bw[ne[0]] = abs(bw[frm] - ne[1])
			dfs(ne[0])

dfs(1)
for i in range(1, n + 1):
	print(bw[i])

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
xyz = [list(map(int,input().split())) for x in range(m)]

checked = [x for x in range(1,n+1)] #checked = 0
xyz.sort()
ans=n
for i in xyz:
    x,y,z = i
    if x in checked and y in checked:
        checked[x-1]=0
        checked[y-1]=0
        ans-=1 #no check
    elif x in checked or y in checked:
        checked[x-1]=0
        checked[y-1]=0
        ans-=1 #one check
    else:
        pass
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
K = input()
S = list(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
S = [input()]

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

Submission status: Runtime Error

Solution code:
n, k = map(int, raw_input().split())
s = list(raw_input())
s[k] = s[k].lower()
ans = ""
for i in s:
  ans = ans + i
print ans

Submission status: Runtime Error

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

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower
  else:
    b += s[i]
    
print(b)

Submission status: Runtime Error

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

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower
  else:
    b += s[i]
    
print(b)

Submission status: Runtime Error

Solution code:
,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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
N,K = (int(x) for x in input().split())
s = input()
print ''.join(x for i,x in enumerate(s) if i != K-1 else x.lower())

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import math
a = int(input())
b = a / 100
b = math.floor(b)
c = a % 100
if b>=1 and b<=12:
    if c>=1 and c<=12:
        print("ANBIGUOUS")
    else:
        print("MMYY")
else:
    if c>=1 and c<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Runtime Error

Solution code:
n,k = [ int(i) for i in input().split(" ") ]
s = input()
print(s[:k] + s[k].lower() + s[k+1:])

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
def main():
    import sys
    from collections import deque
    input = sys.stdin.readline
    N = int(input())
    color = [-1] * N
    color[0] = 0
    uvw = []
    edge = [[]for _ in range(N)]
    # append=uvw.append
    for i in range(N-1):
        ui, vi, wi = map(int, input().split())
        ui -= 1
        vi -= 1
        edge[ui].append((vi, wi))
        edge[vi].append((ui, wi))
    stack = [0]
    for i in range(N):
        tmp = deque()
        while stack:
            i = stack.pop()
            for e, w in edge[i]:
                if color[e] == -1:
                    stack.append(e)
                    if color[i] == 0:
                        if w % 2 == 0:
                            color[e] = 0
                        else:
                            color[e] = 1
                    else:
                        if w % 2 == 0:
                            color[e] = 1
                        else:
                            color[e] = 0
                # ここを追加--------------------------------------
                # 矛盾判定
                else:
                    if (color[i] == color[e]) != (w % 2 == 0):
                        print(-1)
                        exit()
                # ^^^^^^^^--------------------------------------
        # print(color)
        stack = tmp
    print(*color, sep="\n")


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N, K = map(int, input().split())
S = list(input())

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**5-1)

n = int(input())
if n==1:
  print(0)
  exit()
from collections import defaultdict
edge = defaultdict(list)
for i in range(n-1):
  u, v, w = list(map(int, input().split()))
  edge[u].append((v, w))
  edge[v].append((u, w))
graph = [-1 for i in range(n+1)]

def dfs(x, c):
  nexts = edge.get(x)
  if nexts is None:
    return
  if graph[x]!=-1:
    return
  else:
    graph[x] = c
  for y, w in nexts:
    if w%2:
      dfs(y, not c)
    else:
      dfs(y, c)

dfs(1, 0)
for i in range(1, n+1):
  print(int(graph[i]))

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
a = input()
if a[y-1]=="A":
  a[y-1]="a"
if a[y-1]=="B":
  a[y-1]="b"
if a[y-1]=="C":
  a[y-1]="c"
print(a)

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
a = input()
a[y-1] = a[y-1].upper()
print(a)

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
a = input()
a[y] = a[y].upper()
print(a)

Submission status: Runtime Error

Solution code:
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
	if m <= 12 and n >= 1:
    	print('AMBIGUOUS')
    else:
     	print('MMYY')
else:
	if m <= 12 and n >= 1:
    	print('YYMM')
    else:
     	print('NA')

Submission status: Runtime Error

Solution code:
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = int(input())
b1 = a//100
c2 = a%100
henkan(b1,c2)

Submission status: Runtime Error

Solution code:
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = input()
b1 = int(a[0:2])
c2 = int(a[2:4])
henkan(b1,c2)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
c = input()
c[b-1] += 32
print(c)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=input()
if s[k-1]== 'A':
    s[k-1] = 'a'
    print(s)
elif s[k-1]== 'B':
    s[k-1] = 'b'
    print(s)
elif s[k-1]== 'C':
    s[k-1] = 'c'
    print(s)

Submission status: Runtime Error

Solution code:
n, k =map(int, input().split())
STR = input()
str = STR.lower()

if k == 1:
  sTR = str[0] + STR[1:]
elif k == n:
  stR = STR[:n-2] + str[n-1]
else:
  sTR = STR[:k-2] + str[k-1] + STR[:k]

print(sTR)

Submission status: Runtime Error

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

if k == 1:
  sTR = lower(s[0]) + s[1:]
else:
  sTR = s[:k-2] + lower(s[k-1]) + s[:k]

print(sTR)

Submission status: Runtime Error

Solution code:
N = int(input())
graph = {}
root = -1
for n in range(N-1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1

    if root == -1:
        root = u
    if u not in graph:
        graph[u] = {}
    if v not in graph:
        graph[v] = {}
    graph[u][v] = w
    graph[v][u] = w    

answer = [-1] * N
def search(node, depth):
    answer[node] = depth
    for n in graph[node]:
        if answer[n] == -1:
            search(n,depth + graph[node][n])
if N == 1:
    print('0')
else:
    search(root, 0)
    for a in answer:
        print('0' if a % 2 else '1')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
# cook your dish here
import math
        
n,k=map(int,input().split())
summ=0
for i in range(1,n+1):
    if k/i<=1:
        value=0
    elif abs((math.log(k)-math.log(i))//math.log(2)-(math.log(k)-math.log(i))/math.log(2))<=0.00001:
        value = (math.log(k)-math.log(i))//math.log(2)
    else:
        value = (math.log(k)-math.log(i))//math.log(2)+1    
    else:
        value=math.log(k)-math.log(i)
    po=(0.5)**value
    summ+=po
    
summ=summ/n
print('{0:.12f}'.format(summ))

Submission status: Runtime Error

Solution code:
x = range(m)
y = range(m)
n, m = list(map(int, input().split()))
for i in range(m):
   x[i], y[i] = list(map(int, input().split()))

z = x.extend(y)
N = range(n)
for i in range(n):
    N[i] = z.count(i+1)

ans = 0
for i in range(n):
    ans = ans + N.count(i)/(2**i)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
k=input()
S=input()
top=S[k]
if top=='A':
  S[k]='a'
if top=='B':
  S[k]='b'
if top=='C':
  S[k]='c'
print(s)

Submission status: Runtime Error

Solution code:
s=input()
first=int(s[0]+s[1])
second=int(s[2]+s[3])
if 1<=first<=12 and 1<=second<=12:
	print("AMBIGUOUS")
elif 1<=first<=12 and (second==0 or second>=13):
		print("MMYY")
elif (first==0 or first>=13) or 1<=second<=12:
		print("YYMM")
else:
		print("NA")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
s=input()
print(s.replace(s[b-1],lower(s[b-1])))

Submission status: Runtime Error

Solution code:
N,M = input().split()
N = int(N)
M = int(M)
list = []
A_list = []

for i in range(M):
    x,y,z = input().split()
    x,y,z = int(x),int(y),int(z)
    list.append([x,y,z])

A_list.append([list[0][0]])
for data in list:
    check = 0
    for A_data in A_list:
        if data[0] in A_data:
            A_data.append(data[1])
            check = 0
        elif data[1] in A_data:
            A_data.append(data[0])
            check = 0
        elif not data[0] in A_data and not data[1] in A_data:
            check = 1
    if check:
        A_list.append([data[0],data[1]])

print(len(A_list))

Submission status: Runtime Error

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

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

c = ''.join(c)

print(c)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
l=list(map(str,input().split()))
l[k]=lower(l[k])

print(''.join(l))

Submission status: Runtime Error

Solution code:
N, K = input().split()
K = int(K)
N[K-1].lower()
print(N)

Submission status: Runtime Error

Solution code:
def sol(inp=input):
    n=int(inp())
    pots=[None for _ in range(n)]
    edges=[list(map(int,inp().split())) for _ in range(n-1)]
    adj=[{} for _ in range(n)]
    for e in edges:
        adj[e[0]-1][e[1]-1]=e[2]
        adj[e[1]-1][e[0]-1]=e[2]
    
    def dfs(node,pot):
        pots[node]=pot
        for v in adj[node]:
            if pots[v] is None:
                dfs(v,pots[node]+adj[node][v])
    dfs(0,0)
    return [str(p%2) for p in pots]
for c in sol():
  	print(c)

Submission status: Runtime Error

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

#print(S[K-1])
S = (S[:K-2]+S[K-1].lower()+S[K:]
print(S)

Submission status: Runtime Error

Solution code:
    # encoding:utf-8
    import copy
    import random
    import bisect #bisect_left　これで二部探索の大小検索が行える
    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:])

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
S = input()
SS = S[K].lower()
 
SSS = S[:K]+SS+S[K+1:]
 
print(SSS)

Submission status: Runtime Error

Solution code:
n = input()
k = input()
s = input()

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

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())

for i in range(N):
    if 2**i > N:
        a = i-1
        b = N - 2**a
        break
for j in range(K):
    if 2**j > K:
        c = j-1
        d = K - 2**c
        break

if N <= K:
    print((2**(2*a-c+1)+2**(-c)+3*2**(a-c+1)*b)/3*N)
else:
    print((2**(c+1)+2**(-c)+3*2*b)/*3N + (N-K+1)/N)

Submission status: Runtime Error

Solution code:
string = input()
numlist = [int(n) for n in string]
fst = numlist[0] * 10 + numlist[1]
scd = numlist[2] * 10 + numlist[3]
 
  
if string == '0000':
    print('NA')
    
elif fst > 12:
    if scd > 12:
        print('NA')
    else:
      	print('YYMM')
else:
    if scd > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
N, K = map(int,input().split())	
S = input()
S = S.replace(S[K],S[K].lower(),1)
print(S)

Submission status: Runtime Error

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

if (n1>12 and n2>12) or (n1==0 and n2==0) or (n1>12 and n2==0) or (n1==0 and n2>12):
    ans="NA"
elif (n1>12 or n1==0) and (n2<=12 and not n2==0):
    ans="YYMM"
elif (n1<=12 not n1==0) and (n2>12 or n2==0):
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
k = int(input())
s = input()
if k == 1:
    print(s[k-1].lower()+s[k:])
elif k == n:
    print(s[:k-1]+s[k-1].lower())
else:
    print(s[:k-1]+s[k-1].lower()+s[k:])

Submission status: Runtime Error

Solution code:
N,K= map(int, input().split())
S=input() 
S2=str.swapcase(S[K-1])
S3=str.replace(S[K-1],S2)
print(S3)

Submission status: Runtime Error

Solution code:
N,K= map(int, input().split())
S=input() 
print(S[K-1])
S2=str.swapcase(S[K-1])
print(S2)

S3=str.replace(S[K-1],S2)
print(S3)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
s = input()
c = s[k]
s = s[:k] + chr(ord(c) - ord('A') + ord('a')) + s[k + 1:]
print(s)

Submission status: Runtime Error

Solution code:
S=int(input())

a=S/100
b=S%100

if((a>12 or a==0) and 1<=b<=12):
        print("YYMM")

elif(1<=a<=12 and (b>12 or b==0)):
        print("MMYY")

elif(1<=a<=12 and 1<=b<=12):
        print('AMBIGUOUS')

else:
    print("NA")

Submission status: Runtime Error

Solution code:
import sys
import string

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

print(S[int(K)])
print(S[int(K)].lower())
for num in range(int(N)）:
    if N == K:
        print(S[int(K)].lower())
    else:
        print(S[int(K)])

Submission status: Runtime Error

Solution code:
n = int(input())
k = int(input())
s = [str(i) for i in range(n)]

sl = s[k]
sk = sl.lower()
print(sk)

Submission status: Runtime Error

Solution code:
import sys
import string

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

print(S[int(K)])
print(S[int(K)].lower())
for num in range(int(N):
    if N == K:
        print(S[int(K)].lower())
    else:
        print(S[int(K)])

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <ctype.h>
int main()
{
    
    int N,K;
    char S[50];
    std::cin >> N >> K;
    for(int i=0; i<N; i++){
    std::cin >> S[i];
    }
    S[K-1]=(char)tolower(S[K-1]);
    for(int i=0; i<N; i++){
    std::cout << S[i];
    }
  std::cout <<std::endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
import sys
n = list(map(int, input().split()))
s = list(input())
for i in s:
    if i == n[1]:
        print(s[i].lower(),end='')
        break
    print(s[i],end='')

Submission status: Runtime Error

Solution code:
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
  elif(ceil < 1):
    ceil = 1
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)

Submission status: Runtime Error

Solution code:
N = int(input().strip())
x = [[] for x in range(N)]
for i in range(N-1):
     u, v, w = list(map(int, input().split()))
     x[u-1].append([v-1, w])
     x[v-1].append([u-1,w])



ret = {}
done = []

queue = [0]

for i in range(N):
    curr = queue.pop()
    if curr == 0:
        ret[0] = 0

    for neigh in x[curr]:
        if neigh in done:
            continue
        if neigh[1] % 2 == 0:
            ret[neigh[0]] = ret[curr]
        else:
            ret[neigh[0]] = 0 if ret[curr] == 1 else 1

        queue.append(neigh[0])
    done.append(curr)


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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
s=input()
s=s[:m]+chr(ord(s[m])-ord('A')+ord('a'))+s[m+1:]
print(s)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())

s = input()
s[k+1].lower()
print(s)

Submission status: Runtime Error

Solution code:
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()

Submission status: Runtime Error

Solution code:


if __name__ == '__main__':
    N, K = input()
    S = input()
    return replace_nth_to_small_letter(N,K,S)

def replace_nth_to_small_letter(N, K, S):
    if K > N:
        return S

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

Submission status: Runtime Error

Solution code:
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
char_list = [c for c in string]
char_list[k - 1] = char_list[k - 1].lower()
string = ''.join(string_list)
print(string

Submission status: Runtime Error

Solution code:
N, K = input().split()
int(K)
count = 0
K = K - 1
S = ""

for i in N:
    S += i
    count += 1
    if count == K:
        S += i.lower()
print(S)

Submission status: Runtime Error

Solution code:
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif((a>12 or a==0) and 1<=b<=12):
        print("YYMM")

elif(1<=a<=12 and (b>12 or b==0)):
        print("MMYY")

elif(1<=a<=12 and 1<=b<=12):
        print('AMBIGUOU')

else:
    print("NA")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

N=int(input())
edges = [[] for i in range(N)]
colors = [-1]*N
for i in range(N-1):
    u,v,w=[int(a) for a in input().split()]
    edges[u-1].append((v-1,w))
    edges[v-1].append((u-1,w))
 
diff = lambda n: 1 if n==0 else 0
 
def dfs(prev,curr):
    for node,d in edges[curr]:
        if node==prev:
            continue
        colors[node] = colors[curr] if d%2==0 else diff(colors[curr])
        dfs(curr,node)
 
colors[0]=0
dfs(1000000,0)
for i in range(N):
    print(colors[i])

Submission status: Runtime Error

Solution code:
n = int(input())

u = [0] * (n-1)
v = [0] * (n-1)
w = [0] * (n-1)

node = [i for i in range(n)]

group1 = []
group2 = []

for i in range(n-1):
    u[i], v[i], w[i] = map(int, input().split())
    u[i] -= 1
    v[i] -= 1
    w[i] = w[i] % 2
    # 同じなら0、違ったら1
    if w[i] == 0:
        if node[u[i]] == u[i]:
            node[u[i]] = node[v[i]]
        elif node[u[i]] != u[i]:
            node[v[i]] = node[u[i]]

for i in range(n-1):
    if w[i] == 1:
        if u[i] in group1:
            group2.append(node[v[i]])
        elif u[i] in group2:
            group1.append(node[v[i]])
        elif v[i] in group1:
            group2.append(node[u[i]])
        elif v[i] in group2:
            group1.append(node[u[i]])
        else:
            group1.append(node[v[i]])
            group2.append(node[u[i]])

for i in range(n):
    if node[i] in group1:
        node[i] = 0
    else:
        node[i] = 1

for color in node:
    print(color)

Submission status: Runtime Error

Solution code:

class UnionFind(object):
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]
 
 
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])
 
 
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
 
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
n, m = map(int, input().split())
U=UnionFind(n)
for i in range(m):
    x, y, z = map(int, input().split())
    U.unite(x-1, y-1)
cnt=0
for i in range(n):
    if U.find(i)==i:
        cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=list(input())
t=s.pop(k-1)
s.insert(k-1,t.lower())
print("".join(s)

Submission status: Runtime Error

Solution code:
n,k=map(int , input().split())
string=list(input())
result=[]
for i in range(n):
  if i==k-1:
    result.append(chr(ord(string[i])+32))
  else:
    result.append(string[i])
 print(''.join(result))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
S = list(input())
if S[K] == "A":
  S[K] = "a"
  STR = "".join(S)
  print(STR)
elif S[K] == "B":
  S[K] = "b"
  STR = "".join(S)
  print(STR)
else:
  S[K] = "c"
  STR = "".join(S)
  print(STR)

Submission status: Runtime Error

Solution code:
N, K = map(int,input().split())	
Se = input()

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

Submission status: Runtime Error

Solution code:
N = input()
K = int(input())
count = 0
K = K - 1
S = ""

for i in N:
    S += i
    count += 1
    if count == K:
        S += i.lower()
print(S)

Submission status: Runtime Error

Solution code:
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
string_list = string.split()
string_list[k - 1] = string_list[k - 1].lower()
string = ''.join(string_list)
print(string)