Problem:


Score : 100 points

Problem Statement

We have A balls with the string S written on each of them and B balls with the string T written on each of them.

From these balls, Takahashi chooses one with the string U written on it and throws it away.

Find the number of balls with the string S and balls with the string T that we have now.

Constraints

S, T, and U are strings consisting of lowercase English letters.

The lengths of S and T are each between 1 and 10 (inclusive).

S \not= T

S=U or T=U.

1 \leq A,B \leq 10

A and B are integers.

Input

Input is given from Standard Input in the following format:

S T
A B
U

Output

Print the answer, with space in between.

Sample Input 1

red blue
3 4
red

Sample Output 1

2 4

Takahashi chose a ball with red written on it and threw it away.
Now we have two balls with the string S and four balls with the string T.

Sample Input 2

red blue
5 5
blue

Sample Output 2

5 4

Takahashi chose a ball with blue written on it and threw it away.
Now we have five balls with the string S and four balls with the string T.



Sample input:
red blue
3 4
red


Sample output:
2 4

Submission status: Runtime Error

Solution code:
a=input().split()
N=int(a[0])
K=int(a[1])
zantei=0
P=list(map(float,input().split()))

P_ex=list(map(lambda x: (x+1)/2,P))


for i in range(0,K):
    
    zantei+=P_ex[i]
zanans=0
buffer=P_ex[0]
beforeans=zantei
for i in range(1,N-K+1):
    if(beforeans-buffer+P_ex[K+i-1]>zantei):
        zantei=beforeans+P_ex[K+i-1]-buffer
    buffer=P_ex[i]
    beforeans+=P_ex[K+i-1]-buffer

print(zantei)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
lis = list(map(int,input().split()))
tmp = 0
for i,l in enumerate(lis):
    if i+k <= len(lis)-1:
        #print(i,k)
        if lis[i+k]>l:
            tmp = i+1
#print(tmp)
#print(new_lis)
#print(lis[tmp:tmp+k])
print(sum([(ll+1)/2 for ll in  lis[tmp:tmp+k+1]]))
#print((sum(lis[tmp:tmp+k])+k)/2)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
counter = 0
for val in range(N - 1):
    for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
            break
    else:
        continue
    break
if counter == 0:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
from typing import *
import math
import collections, itertools, functools, heapq, bisect

def main():
    S, T = input().split()
    A, B = [int(x) for x in input().split()]
    U = input().strip()
    
    if U == S:
        A -= 1
    elif U == T:
        B -= 1
    print(' '.join([str(x) for x in [A, B]]))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
X = [input().split(" ") for i in range(3)]
s = X[0]  #["S","T"]
Y = X[1]  #["A","B"]
u = X[2]  #"U"
 
y = list(map(int,Y))
a = y[0]
b = y[1] 
 
if s[0] == X[2]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
S,T,A,B,U = [input().split(" ") for i in range(4)]
a = int(A)
b = int(B)

if S == U:
  print(a-1,b)
  else:
    print(a,b-1)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(4100000)
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitai=[0]*N
kitaiwa=[0]*(N-K+1)
for i in range(N):
    kitai[i]=(p[i]+1)/2
if N==K:
    print(sum(kitai))
elif K==1:
    print(max(kitai))
else:
    for i in range(N-K+1):
        for j in range(K):
            kitaiwa[i]+=kitai[i+j]
    print(max(kitaiwa))

Submission status: Runtime Error

Solution code:
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitai=[0]*N
kitaiwa=[0]*(N-K+1)
for i in range(N):
    kitai[i]=(p[i]+1)/2
if N==K:
    print(sum(kitai))
elif K==1:
    print(max(kitai))
else:
    for i in range(N-K+1):
        for j in range(K):
            kitaiwa[i]+=kitai[i+j]
    print(max(kitaiwa))

Submission status: Runtime Error

Solution code:
X = [input().split(" ") for i in range(4)]
s = X[0]  #["S","T"]
Y = X[1]  #["A","B"]
u = X[2]  #"U"
 
y = list(map(int,Y))
a = y[0]
aa = a-1
b = y[1] 
bb = b-1 
 
if s[0] == u:
  print(aa,b)
  else:
    print(a,bb)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, 😎

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
i=0
c="YES"   ##ここ文字列だからくおーてーしょんいるの注意
for i in range(a-1):
 j=i+1
 for j in range (a-1):
    if b[i]==b[j]:
    c="NO" ##ここも
print(c)

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
l=list(map(int,input().split()))
a=[]
for i in range(N-K+1):
    b=sum(l[i:i+K])+K
    a.append(b)
    b=0
print(max(a)/2)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 無限 #####
# f_inf = float('inf')

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	A = inputList()

	A.sort()

	for i,val in enumerate(A):
		if i == 0:
			continue
		if val == A[i-1]:
			print("NO")
			sys.exit()

	print("YES")

if __name__ == "__main__":
	main()

Submission status: Runtime Error

Solution code:
S,T=input().split()
A,B=map(int,input().split())
U = input()
if U == S:
    print (f"{A-1} {B}")
else:
    print(f"{A} {B-1}")

Submission status: Runtime Error

Solution code:
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitai=[0]*N
kitaiwa=[0]*(N-K+1)
if N=K:
    print(sum(kitai))
elif K==1:
    print(max(kitai))
else:
    for i in range(N):
        kitai[i]=(p[i]+1)/2
    for i in range(N-K+1):
        for j in range(K):
            kitaiwa[i]+=kitai[i+j]
    print(max(kitaiwa))

Submission status: Runtime Error

Solution code:
def main():
    def ex_value(dice):
      n = 0
      for i in range(1,dice+1):
        n += i*1/dice
      return(n)
    n,k = map(int, input().split())
    list_p = list(map(int, input().split()))
    list_ex_val = list(map(ex_value, list_p))
    sum_k=[]
    for i in range(n-k+1):
        sum_k.append(sum(list_ex_val[i:i+k]))
    print(max(sum_k))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

# 整数の入力
#a = int(input())
# スペース区切りの文字列の入力
st = input().split()
st_list = []
st_list = [int(st) for st in st]

# スペース区切りの数値の入力
a, b = map(int, input().split())

# 文字列の入力
s = input()

# スペース区切りの文字列の入力
#a,b = map(input().split())

if(str(s) == st_list[0]):
  a = a-1
elif(str(s) == st_list[1]):
  b = b-1
# 出力

print(a,b)

Submission status: Runtime Error

Solution code:
import numpy as np
def Expected_Value(x):
    EV = 0
    for i in range(1,x+1):
        EV += i/x
    return EV
N, K = map(int, input().split())
pi = np.array(list(map(int, input().split())))
ma = 0
for i in range(N-K+1):
    x = sum(pi[i:i+K])
    if x > ma:
        ma = x
        max_index = i
array_max = (np.array(pi[max_index:max_index+K])-1) *0.5 + 1
print(array_max.sum())

Submission status: Runtime Error

Solution code:
S, T= input().split()
A, B= map(int, input().split())
U= input().split()
 
if (S==U):
    print(A-1,B)
else if (T==U):
    print(A,B-1)
else:
    print(A,B)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
i=0
j=0
c="YES"  ##ここ文字列だからくおーてーしょんいるの注意
for i in range(a-1):
  for j in range (a-1):
    if b[i]==b[j]
    c="NO" 
print(c)

Submission status: Runtime Error

Solution code:
import sys
import collections

N = int(input())
A_i = list(map(int, input().split()))
A_i = [i for i in A_i if 1 <= i and i <= 10**9]

if not 2 <= N or not N <= 2*10**5:
    print("error:N")
    sys.exit()

if len(collections.Counter(A_i)) == len(A_i):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
X = [input().split(" ") for i in range(2)]
s = X[0]  #["S","T"]
Y = X[1]  #["A","B"]
u = X[2]  #"U"

Submission status: Runtime Error

Solution code:
[S, T] = input().split()
[A, B] = input().split()
U = input()

if U == S:
    print(f"{int(A)-1} {B}")
else:
    print(f"{A} {int(B) - 1}")

Submission status: Runtime Error

Solution code:
def main():
	all,rolls=map(int,input().split())
	List=list(map(int,input().split()))

	sum = 0
	sumList =[]

	for i in range(all - rolls + 1):
		sum = 0
		for j in range(rolls):
			sum = sum + (List[i + j] + 1) / 2
		sumList.append(sum)

	sumList.sort(reverse=True)
	print(sumList[0])

if __name__ == '__main__':
	main()

Submission status: Runtime Error

Solution code:
S, T= input().split()
A, B= map(int, input().split())
U= input().split()
 
if (S==U):
    print(A-1,B)
else if (T==U):
    print(A,B-1)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
A = int(input())
B = int(input())
U = input()

if U == T:
    B -= 1
if U == S:
    A -= 1

print(A , " " , B)

Submission status: Runtime Error

Solution code:
n=int(input())
K=int(input())
if K==1:
    counter=0
    for i in range(100):
        for j in range(1,10):
            a="0"*(i)+str(j)+"0"*(99-i)
            if 1<=int(a)<=n:
                counter+=1
    print(counter)
elif K==2:
    counter=0
    for i in range(100):
        for j in range(i+1,100):
            for k in range(1,10):
                for l in range(1,10):
                    a="0"*(i)+str(k)+"0"*(j-i-1)+str(l)+"0"*(99-j)
                    if 1<=int(a)<=n:
                        counter+=1
    print(counter)
elif K==3:
    counter=0
    for i in range(100):
        if 100-i>len(str(n)):
            pass
        elif 100-i<len(str(n)):
            for j in range(i+1,100):
                for k in range(j+1,100):
                    counter+=9*9*9
        elif 100-i==len(str(n)):
            for j in range(i+1,100):
                for k in range(j+1,100):
                    for a in range(int(str(n)[i]),int(str(n)[i])+1):
                        for b in range(1,10):
                            for c in range(1,10):
                                P=str(a)+"0"*(j-i-1)+str(b)+"0"*(k-j-1)+str(c)+"0"*(99-k)
                                if 1<=int(P)<=n:
                                    counter+=1
            counter+=((98-i)*(99-i)//2)*9*9*(int(str(n)[i])-1)
    print(counter)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

all,rolls=map(int,input().split())
List=list(map(int,input().split()))

sum = 0
sumList =[]

for i in range(all - rolls + 1):
	sum = 0
	for j in range(rolls):
		sum = sum + (List[i + j] + 1) / 2
	sumList.append(sum)

sumList.sort(reverse=True)
print(sumList[0])

Submission status: Runtime Error

Solution code:
[S, T] = input().split()
[A, B] = input().split()
U = input()
 
if U == S:
    print(f"{int(A)-1} {B}")
else:
    print(f"{A} {int(B) - 1}")

Submission status: Runtime Error

Solution code:
S = input()
T = input()
A = int(input())
B = int(input())
U = input()

if U == T:
    B -= 1
if U == S:
    A -= 1
    
print(str(A) +  " " + str(B))

Submission status: Runtime Error

Solution code:
import numpy as np
N,K = map(int,input().split())
P = list(map(int,input().split()))
total = 0
for i in range(N-K+1):
  A = P[i:i+K]
  total = sum(A)
  if total>0:
    B = A
np.array(B)
C = (B+np.array([1]))/np.array([2])
print(sum(C))

Submission status: Runtime Error

Solution code:
N = int(input())
A = input().split()
for i in A:
    A = [j for j in A if j != i]
    if len(A) == N - 1:
        N -= 1
        continue
    else:
        print("NO")
        break
if N == 0:
    print("YES")

Submission status: Runtime Error

Solution code:
X = [input().split(" ") for i in range(2)]
s = X[0]  #["S","T"]
Y = X[1]  #["A","B"]
u = X[2]  #"U"
 
y = list(map(int,Y))
a = y[0]
aa = a-1
b = y[1] 
bb = b-1 

if s[0] == u:
  print(aa,b)
  else:
    print(a,bb)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = list(map(int, input().split()))
U = input()

if U == "red":
    A = A - 1
elif U == "blue"
    B = B - 1
else:
    pass

print(A, B)

Submission status: Runtime Error

Solution code:
def main():
	n=int(input())
	a=list(map(int, input().split()))
	count = 0
	while count==0:
		for i in range(n):
			if  a.count(a[i])> 1:
				count+=1
				print('NO')
				break
			else:
				continue
	if count==0:
		print('YES')
main()

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(4100000)
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitaiwa=[0]*(N-K+1)
for i in range(N):
    p[i]=(p[i]+1)/2
for i in range(N-K+1):
    kitaiwa[i] = sum(p[i:i+K])
print(max(kitaiwa))

Submission status: Runtime Error

Solution code:
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitaiwa=[0]*(N-K+1)
for i in range(N):
    p[i]=(p[i]+1)/2
for i in range(N-K+1):
    kitaiwa[i] = sum(p[i:i+K])
print(max(kitaiwa))

Submission status: Runtime Error

Solution code:
X = [input().split(" ") for i in range(2)]
s = X[0]  #["S","T"]
Y = X[1]  #["A","B"]
u = X[2]  #"U"
 
y = list(map(int,Y))
a = y[0]
b = y[1] 
 
if s[0] == u:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
p=tuple(map(float,input().split()))
exp=tuple([(pi+1)/2 for pi in p])
ans=0
for i in range(0,n-k+1):
  ans=max(ans,sum(exp[i:i+k]))
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# Input
s = [input() for i in range(3)]
ST = list(s[0].split())
S = str(ST[0])
T = str(ST[1])

AB = list(s[1].split())
A = int(AB[0])
B = int(AB[1])

U = str(s[3])


# Proccess
If U == S:
	A -= 1
else:
	B -= 1

# Output							
print(str(A)+" "+str(B))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
counter = 0
for val in range(N - 1):
    for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
        else:
            continue
if counter == 0:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
S,T=input().split()
A,B=map(int, input().split())
U=input().split()
if(S==U):print(A-1,B)
else if(T==U):print(A,B-1)

Submission status: Runtime Error

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

ls = P[0:K]
summ = sum(ls)
ans = [0]*K

for i in range(N-K+1):
    if summ < sum(P[i:i+K]):
        ls = P[i:i+K]
        summ = sum(ls)
for j in range(K):
    ans[j]=(ls[j]+1)*ls[j]/(2*ls[j])
print(sum(ans))

Submission status: Runtime Error

Solution code:
X = [input() for i in range(2)]
s = X[0]
Y = X[1]
u = X[2]

y = list(map(int,Y))
a = y[0]
b = y[1] 
 
if s[0] == u:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
s, t = input().split()
n1, n2 = int(input()).split()
i = input()
if(i==s):
  return n1=n1-1
elif(i==t)
  return n2=n2-1
print(n1,n2)

Submission status: Runtime Error

Solution code:
S,T = map(input().split(" "))
A,B = map(int,input().split(" "))
U = input()

if S==U:
  A-=1
else:
  B-=1
  
print(f"{A} {B}")

Submission status: Runtime Error

Solution code:
S,T = map(input().split())
A,B = map(int,input().split())
U = input().split()

if S==U:
  A-=1
else:
  B-=1
  
print(f"{A} {B}")

Submission status: Runtime Error

Solution code:
S,T,A,B,U = [input() for i in range(2)]
a = int(A)
b = int(B) 

if S == U:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

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

a = {x:y for x in n for y in m}

a[c] -= 1
print(*a.values())

Submission status: Runtime Error

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

a = {x:y for x in n for y in m}

a[c] = a[c]-1
print(a.values())

Submission status: Runtime Error

Solution code:
all,rolls=map(int,input().split())
List=list(map(int,input().split()))

sum = 0
sumList =[]

for i in range(all - rolls + 1):
	sum = 0
	for j in range(rolls):
		sum = sum + (List[i + j] + 1) / 2
	sumList.append(sum)

sumList.sort(reverse=True)
print(sumList[0])

Submission status: Runtime Error

Solution code:
n = int(input())
*l, = map(int, input().split())
def has_duplicates(seq):
    return len(seq) != len(set(seq))
S = has_duplicates(l)
if str(S) == 'False':
  print('YES')
elif str(S) == 'True':
  print('NO')

Submission status: Runtime Error

Solution code:
n = [input().split(" ") for i in range(2)]
y = n[0]
Y = list(map(str,y))
s = Y[0]
x = n[1]
X = list(map(int,x))
a = X[0]
b = X[1]
 
if s == n[2]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

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

a = {x:y for x in n for y in m}

a[c] = a[c]-1
print(a[c])

Submission status: Runtime Error

Solution code:
n = [input().split(" ") for i in range(2)]
y = n[0]
Y = list(map(str,y))
s = Y[0]
x = n[1]
X = list(map(int,x))
a = X[0]
b = X[1]
 
if s == n[2]:
  print(a-1,b)
  else:
    print(a,b-1)

Submission status: Runtime Error

Solution code:



color = input.split()

num = input.split()

stock[color[0]] = num[0]
stock[color[1]] = num[1]

u = input.split()

stock[u] = stock[u] - 1

print({col1} {col2}).format(col1=stock[color[0]],col2=stock[color[1]])

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
counter = 0
for val in range(N - 1):
     for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
        else:
            break
if counter == 0:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

total_expects = []
# 1回のサイコロについて
for i in range(0, n):    
    # 1個のサイコロの期待値リスト
    expect = [q * (1 / p[i]) for q in range(1, p[i]+1)]
    total_expects.append(sum(expect))

print(max([sum(total_expects[i:i+k]) for i in range(0, k)]))

Submission status: Runtime Error

Solution code:
stra=eval(input())
strb=eval(input())
num1=eval(input())
num2=eval(input())
chosen=eval(input())
if chosen == stra:
  num1-=1
elif chosen ==strb:
  num2-=1
print (num1,num2)

Submission status: Runtime Error

Solution code:
n = input().split(" ")
m = map(int, input().split(" "))
c = input()

a = {x:y for x in n for y in m}

a[c] = a[c]-1
print(a.values())

Submission status: Runtime Error

Solution code:
import numpy as np
N, K = map(int, input().split())
pi = list(map(int, input().split()))
K_sum = []
for i in range(N-K+1):
    K_sum.append(sum(pi[i:i+K])) 
index = K_sum.index(max(K_sum))
array_max = (np.array(pi[index:index+K])-1) *0.5 + 1
print(array_max.sum())

Submission status: Runtime Error

Solution code:
n = [input().split() for i in range(2)]
y = n[0]
Y = list(map(str,y))
s = Y[0]
x = n[1]
X = list(map(int,x))
a = X[0]
b = X[1]
 
if s == n[2]:
  print(a-1,b)
  else:
    print(a,b-1)

Submission status: Runtime Error

Solution code:
n = [input().split() for i in range(2)]
y = n[0]
Y = list(map(str,y))
s = Y[0]
x = n[1]
X = list(map(int,x))
a = X[0]
b = X[1]
 
if s == n[2]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
S,T = input("Enter the color").split()
A,B = int(input("Enter two value: ").split()) 
U = input("Color you want")
if U==S:
  A=A-1
  print(A)
else:
  B=B-1
  print(B)

Submission status: Runtime Error

Solution code:
n = input().split(" ")
m = map(int, input().split(" "))
c = input()

a = {x:y for x in n for y in m}

a[c] = a[c]-1
print(a[c])

Submission status: Runtime Error

Solution code:
S, T= input().split()
A, B= map(int, input().split())
U= input().split()

if (S==U):
    print(str(A-1) B)
else:
    print(A str(B-1))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

#入力
n = int(input())

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

result = 'YES'

#処理
for i in range(n):
    for j in range(n):
        if j == i:
            continue
        else:
            if A[i] == A[j]:
                result = 'NO'
                
                goto .end


label.end
#出力
print(result)

Submission status: Runtime Error

Solution code:
import numpy as np

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

print(np.alen(set(filter(lambda s: np.count_nonzero(list(map(int, str(s)))) == K, range(0, N+1)))))

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())

count = 0
i = 1
while i <= N:
  s = str(i)
  if K == (len(s) - s.count("0")):
    count = count + 1
  i = i + 1

print(count)

Submission status: Runtime Error

Solution code:
n = [input().split() for i in range(2)]
x = n[1]
X = list(map(int,x))
a = X[0]
b = X[1]
 
if n[0[0]] == n[2]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
n.m = input().split()
r,b = map(int,input().split())
t = input()
if n == t:
  print(str(r-1) + ' ' + str(b))
else:
  print(str(r) + ' ' + str(b-1))

Submission status: Runtime Error

Solution code:
n = int(input())
tmp = input().split()
length = len(tmp)
length2 = len(list(set(tmp)))
if length == length2 :
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())

count = 0
i = 1
while i <= N:
  s = str(i)
  if K == len(s) - s.count("0"):
    count = count + 1
  i = i + 1

print(count)

Submission status: Runtime Error

Solution code:
S, T= input().split()
A, B= map(int, input().split())
U= input().split()

if (S==U):
    print(A-1 B)
else:
    print(A B-1)

Submission status: Runtime Error

Solution code:
import sys
n = int(input())
a = list(map(int,input().split()))
'''
for num in a:
  i = a.index(num)
  if(num in a[i+1:]):
    print("NO")
    sys.exit()
print("YES")
'''

i=0
while(i<n):
  if(a[i] in a[i+1:]):
    print("NO")
    sys.exit()
  i += 1
print("YES")

Submission status: Runtime Error

Solution code:
S,T = input("Enter the color").split()
A,B = input("Enter the number").split()
U = input("Color you want")
if U==S:
  print(A-=1)
else:
  print(B-=1)

Submission status: Runtime Error

Solution code:
n = [input().split() for i in range(2)]
a = n[1]
A = int(n[0])
b = n[1]
B = int(n[1])
S = n[0]
 
if S[0] == n[2]:
  print("A-1","B")
  else:
    print("A","B-1")

Submission status: Runtime Error

Solution code:
S,T = input("Enter the color").split()
A,B = int(input("Enter the number").split())
U = int(input("Color you want"))
if U==S:
  print(A-=1)
else:
  print(B-=1)

Submission status: Runtime Error

Solution code:
s,t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
  a -= 1
 else:
  b -= 1
 print(a,b)

Submission status: Runtime Error

Solution code:
S, T= input().split()
A, B= int(input().split())
U= input().split()

if (S==U):
    print(A-1 B)
else:
    print(A B-1)

Submission status: Runtime Error

Solution code:
n = [input().split() for i in range(2)]
a = n[1]
A = int(n[0])
b = n[1]
B = int(n[1])
 
if n[0[0]] == n[2]:
  print("A-1","B")
  else:
    print("A","B-1")

Submission status: Runtime Error

Solution code:
s, t = input()
a, b = input().split(" ")
u = input()
a = int(a)
b = int(b)
u = int(u)

if u == s:
  print(a - 1, b)
else:
  print(a, b-1)

Submission status: Runtime Error

Solution code:
import copy
n = input()
k = int(input())

n_list = []
for a in n:
    n_list.append(int(a))
n_num = len(n_list)

dp = [[0] * 2 for _ in range(n_num)]
dp[0][0] = 1
for i in range(n_num):
    nxt = [[0] * 2 for _ in range(n_num + 1)]
    for j in range(n_num):
        for l in range(2):
            lim = 9 if l else n_list[i]
            for x in range(lim + 1):
                if x != 0:
                    ns = j + 1
                else:
                    ns = j
                nlt = l | (x < n_list[i])
                nxt[ns][nlt] += dp[j][l]
    dp = copy.deepcopy(nxt)
ans = dp[k][0] + dp[k][1]
print(ans)

Submission status: Runtime Error

Solution code:
input_list = input().split()
input_list2 = list(map(input().split()))
delete_ball = input()
for ind, n in enumerate(input_list):
  if n == delete_ball:
    input_list2[ind] -= 1
print(input_list2)

Submission status: Runtime Error

Solution code:
i = input()
print(re.sub'[abcdefghijklmnopqrstuvwyz]', 'x',i)

Submission status: Runtime Error

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n ,k = i2()
p = intl()
def sx(n):
    return (n+1)/2

m = 0
pnt = 0
for i in range(0,n-k+1):
    s = sum(p[i:i+k])
    if s > m:
        m = s
        pnt = i
cnt = 0
for j in range(pnt,pnt+k):
    cnt += sx(p[j])
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
A = input().split()
ans = 1

for x in range(N):
    for y in range(N):
        if(x == y):
            continue
        if(A[x] == A[y]):
            ans = 0
            break

if(ans == 1):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
import numpy as np
N,K=map(int,input().split())
P=np.array(list(map(int,input().split())))

max_value=0
for i in range(N-K+1):
    if max_value < sum(P[i:i+K]):
        max_value = sum(P[i:i+K])
        max_i = i
max_vector = P[max_i:max_i+K]

sum_ex = 0
for i in range(K):
    sum_ex = sum_ex + sum(np.arange(max_vector[i]+1)) / max_vector[i]
print(sum_ex)

Submission status: Runtime Error

Solution code:
n = [input().split() for i in range(2)]
a = int(n[1[0]])
b = int(n[1[1]])
 
if n[0[0]]==n[2]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
a = int(input())
li = list(map(int, input().split()))
li2 = []

for i in range(a):
    li2.append(li[i])

if len(li2) != len(set(li2)):
    print('NO')
else:
    print('YES')

Submission status: Runtime Error

Solution code:
n, k = (int(x) for x in input().split())
p = list(int(x) for x in input().split())

max_val = 0
for i in range(0, len(p)-k+1):
  tmp = p[i:i+k]
  val = sum([sum([x for x in range(1, t+1)]) / t for t in tmp])

  if max_val < val:
    max_val = val

print('{:.12f}'.format(val))

Submission status: Runtime Error

Solution code:
array = list(input())
colr1 = array[0]
colr2 = array[1]
array2 = list(int(input()))
colr = input()
if colr==colr1:
  array2[0]-=1
if colr==colr2:
  array2[1]-=1
print(array2)

Submission status: Runtime Error

Solution code:
n = [input() for i in range(4)]
a = int(n[2])
b = int(n[3])
 
if n[0]==n[4]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
# それぞれのボールの文字列を取得
a = input()
b = input()

# それぞれのボールの個数を取得
aCount = int(input())
bCount = int(input())
ball = []
ball.append(aCount)
ball.append(bCount)

# 取り出したボールの文字列を取得
selectBall = input()

if selectBall == a:
    aCount = aCount-1
    ball[0] = aCount
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bCount = bCount-1
    ball[1] = bCount
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))

Submission status: Runtime Error

Solution code:
# それぞれのボールの文字列を取得
a = input()
b = input()

# それぞれのボールの個数を取得
aCount = int(input())
bCount = int(input())
ball = []
ball.append(aCount)
ball.append(bCount)

# 取り出したボールの文字列を取得
selectBall = input()

# それぞれの文字列の文字数を取得
# aLength = len(a)
# bLength = len(b)

# print(aLength)
# print(bLength)

if selectBall == a:
    aCount = aCount-1
    # print(aCount)
    ball[0] = aCount
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bCount = bCount-1
    ball[1] = bCount
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))

Submission status: Runtime Error

Solution code:
s = intput().split()
a = list(map(int, input().split()))
u = input()

if u == s[0]:
    print(a[0]-1, a[1])
else:
    print(a[0], a[1]-1)

Submission status: Runtime Error

Solution code:
S, T = list(map(str,input().split()))
A, B = list(map(int,input().split()))
U = str(input())

def main():
    if S is U:
        A -= 1
    elif T is U:
        B -= 1
    else:
        pass

    print(A,B)
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
*l, = map(int, input().split())
L = sorted(l)
S = 0
for i in range(n):
  for l in range(n):
    if L[i] == L[l]:
      S = 1
if S == 0:
  print('Yes')
elif S == 1:
  print('No')

Submission status: Runtime Error

Solution code:
lists = input()
n = [input() for i in range(lists)]
a = int(n[2])
b = int(n[3])
 
if n[0]==n[4]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Submission status: Runtime Error

Solution code:
N = int(input())
A = input().split()
flag = 1

for j in range(N):
	for i in range(N):
		if i+j+1<N:
			if A[j] == A[i+j+1]:
				flag = 0
				break
if flag==0:
	print('NO')
elif flag==1:
	print('YES')

Submission status: Runtime Error

Solution code:
lists = input()
n = [input() for i in range(times)]
a = int(n[2])
b = int(n[3])

if n[0]==n[4]:
  print("a-1","b")
  else:
    print("a","b-1")

Submission status: Runtime Error

Solution code:
array = list(input())
colr1 = array[0]
colr2 = array[1]
array2 = list(int(input()))
colr = input()
if colr==colr1:
  array2[0]-=1
if colr==colr2:
  array2[1]-=1:
print(array2)

Submission status: Runtime Error

Solution code:
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

if U = S:
  	A -= 1
else:
  	B -= 1

print(A),
print(B)

Submission status: Runtime Error

Solution code:
[S, T] = input().split()
print(S)
print(T)

[A, B] = input().split()

U = input()

if U == S:
    print(f"{int(A)-1} {B}")
else:
    print(f"{A} {int(B) - 1}")

Submission status: Runtime Error

Solution code:
S , T =  [str(x) for x in input().split()]

A , B =  [int(x) for x in input().split()]

U = input()
    
if S ==  U:
    A = A - 1
else:
    B = B - 1
    
print(A,B)
S = input()
print('x'*len(S))

Submission status: Runtime Error

Solution code:
s,t=map(sting,input())
a,b=map(int,input())
u=map(sting,input())

if s==u:
    print(a-1,b)
else
    print(a,b-1)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if S == U:
    A -= 1
elif T == U:
    B -= 1
print(f"{A} {B}")