TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese snack.)_  To make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.  What will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?  Assume that you have sufficient numbers of banknotes, and so does the clerk.

Submission attempts (in order):
n = list(map(int, input()))

l = [0] * (len(n)+2)
carry = 0
for i, k in enumerate(n):
  if k > 5 - carry:
    l[i+1] = k - 10
    l[i] += 1
    carry = 1
    while l[i] >= 6 - (1 if l[i-1] <= 0 else 0):
      l[i] -= 10
      i -= 1
      l[i] += 1
  else:
    l[i+1] = k
    carry = 0
print(l)
print(sum(abs(i) for i in l))

n = list(map(int, input()))
 
l = [0] * (len(n)+1)
carry = 0
for i, k in enumerate(n):
  if k > 5 - carry:
    l[i+1] = k - 10
    l[i] += 1
    carry = 1
    while l[i] >= 6 - (1 if l[i-1] < 0 else 0):
      l[i] -= 10
      i -= 1
      l[i] += 1
      if i == 0:
        break
  else:
    carry = 0

n = list(map(int, input()))
dp = (0, 1)
for i in n:
  dp = (min(dp[0] + i, dp[1] + 10 - i), min(dp[0] + i + 1, dp[1] + 9 - i))
print(dp[0])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese snack.)_  To make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.  What will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?  Assume that you have sufficient numbers of banknotes, and so does the clerk.

Submission attempts (in order):
n = input()
n = n[::-1]
n += '0'
cnt = 0
tmp = 0
print(n)
for i in range(len(n)):
    a = int(n[i])
    a += tmp
    if a == 5:
        cnt += a
        if int(n[i + 1]) >= 5:
            tmp = 1
        else:
            tmp = 0
    elif a < 5:
        cnt += a
        tmp = 0
    else:
        cnt += 10 - a
        tmp = 1
print(cnt)

n = input()
n = n[::-1]
n += '0'
cnt = 0
tmp = 0
for i in range(len(n)):
    a = int(n[i])
    a += tmp
    if a == 5:
        cnt += a
        if int(n[i + 1]) >= 5:
            tmp = 1
        else:
            tmp = 0
    elif a < 5:
        cnt += a
        tmp = 0
    else:
        cnt += 10 - a
        tmp = 1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese snack.)_  To make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.  What will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?  Assume that you have sufficient numbers of banknotes, and so does the clerk.

Submission attempts (in order):
n = input()[::-1]
print(n)
cnt = 0
flag = 0
for i in range(len(n)-1):
    if int(n[i])+flag < 5:
        cnt += int(n[i])+flag
        flag = 0
    elif int(n[i])+flag > 5:
        cnt += (10-int(n[i])-flag)
        flag = 1
    else:
        if int(n[i+1]) >= 5:
            cnt += (10 - int(n[i])-flag)
            flag = 1
        else:
            cnt += (int(n[i]) + flag)
            flag = 0
if int(n[-1])+flag > 5:
    cnt += (11 - int(n[-1])-flag)
else:
    cnt += int(n[-1])+flag
print(cnt)


n = input()[::-1]
cnt = 0
flag = 0
for i in range(len(n)-1):
    if int(n[i])+flag < 5:
        cnt += int(n[i])+flag
        flag = 0
    elif int(n[i])+flag > 5:
        cnt += (10-int(n[i])-flag)
        flag = 1
    else:
        if int(n[i+1]) >= 5:
            cnt += (10 - int(n[i])-flag)
            flag = 1
        else:
            cnt += (int(n[i]) + flag)
            flag = 0
if int(n[-1])+flag > 5:
    cnt += (11 - int(n[-1])-flag)
else:
    cnt += int(n[-1])+flag
print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese snack.)_  To make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.  What will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?  Assume that you have sufficient numbers of banknotes, and so does the clerk.

Submission attempts (in order):
N = [int(x) for x in input()]


def solve(N):
    
    
    dp = 0, 1
    print(dp)
    for n in N:
        
        a = min(dp[0] + n, dp[1] + 10 - n)
        
        b = min(dp[0] + n + 1, dp[1] + 10 - (n + 1))
        dp = a, b
    return dp[0]


print(solve(N))


n = input()
l = len(n)
n = int(n)
ans = 0


def c(l, n, ans):
    print(ans)
    a = n // (10 ** (l - 1))
    if l == 1:
        if a <= 5:
            return ans + a
        else:
            return ans + 1 + (10 - a)
    elif a == 5 and l > 1:
        if (n // (10 ** (l - 2))) % 10 <= 4:
            return c(l - 1, n % (10 ** (l - 1)), ans + a)
        else:
            return c(l, 10 ** l - n, ans + 1)
    elif a <= 4 and l > 1:
        return c(l - 1, n % (10 ** (l - 1)), ans + a)
    else:
        return c(l, 10 ** l - n, ans + 1)


print(c(l, n, ans))


N = [int(x) for x in input()]


def solve(N):
    
    
    dp = 0, 1
    for n in N:
        
        a = min(dp[0] + n, dp[1] + 10 - n)
        
        b = min(dp[0] + n + 1, dp[1] + 10 - (n + 1))
        dp = a, b
    return dp[0]


print(solve(N))


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese snack.)_  To make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.  What will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?  Assume that you have sufficient numbers of banknotes, and so does the clerk.

Submission attempts (in order):
#E
N = list(input())
ans = 0
upped = False

for num in reversed(N):
    num = int(num)
    if upped:
        if num + 1 >5:
            ans += ((10-num))
            upped = True
        else:
            ans += num - 1
            upped = False
    else:
        if num >5:
            ans += (1+(10-num))
            upped = True
        else:
            ans += num
            upped = False
            
print(ans)


N = [int(x) for x in input()]
dp = 0,1
for item in N:
    a = min(dp[0] + item, dp[1] + 10 - item)
    b = min(dp[0] + item + 1, dp[1] + 10 - (item + 1))
    dp = a, b
    
print(dp[0])

Verdicts: Wrong Answer

Accepted
Problem: In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese snack.)_  To make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.  What will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?  Assume that you have sufficient numbers of banknotes, and so does the clerk.

Submission attempts (in order):
from sys import setrecursionlimit
n = "0"+input()
N = len(n)
point = 0
for i in range(1,N):
    if int(n[i]) >= 6:
        point += 10-int(n[i])
    else:
        point += int(n[i])
print(point)

n = "0" + input() 
N = len(n)
plus = 1
just = 0
for i in range(1,N):
    
    plus_plus = plus+10-(int(n[i])+1)
    plus_just = plus+10-int(n[i])
    
    just_plus = just+1+int(n[i])
    just_just = just+int(n[i])
    
    plus = min(plus_plus,just_plus)
    just = min(just_just,plus_just)


print(just)

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (s, t) = [e for e in lines[0].split(" ")]
    (a, b) = [int(e) for e in lines[1].split(" ")]
    u = lines[2]

    return (s, t, a, b, u)


def solve(s, t, a, b, u):
    
    a2 = a
    b2 = b
    if s == u:
        a2 = a2 - 1
    elif t == u:
        b2 = b2 - 1
    
    result = ' '.join([a2, b2])

    return result
    


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (s, t) = [e for e in lines[0].split(" ")]
    (a, b) = [int(e) for e in lines[1].split(" ")]
    u = lines[2]

    return (s, t, a, b, u)


def solve(s, t, a, b, u):
    
    a2 = a
    b2 = b
    if s == u:
        a2 = a2 - 1
    elif t == u:
        b2 = b2 - 1
    
    result = ' '.join([str(a2), str(b2)])

    return result
    


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S, T = input().split()
A, B = input().split()
U = input()

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

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
color=input().split()
x,y=map(int,input().split())
color2=input()

if color2==color[0]:
    print(x-1)
else:
    print(y-1)

color=input().split()
x,y=map(int,input().split())
color2=input()

if color2==color[0]:
    print(x-1,y)
else:
    print(x,y-1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U==S:
  A=A-1
elif U==T:
  B=B-1
print({} {}.format(A,B))

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



Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S, T = input().split()
s, t = map(int, input().split())
U = input()
dic = {S:s, T:t}
dic[U] -= 1
print([num for num in dic.values()])

S, T = input().split()
s, t = map(int, input().split())
U = input()
dic = {S:s, T:t}
dic[U] -= 1
print(dic[S], dic[T])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
  print(a-1)
elif t==u:
  print(b-1)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def expect(p):
    return (int(p)+1)/2

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

sum_list = [sum(P[0:K])]
S = [sum(P[0:i]) for i in range(len(P))]
E = []

for i in range(N-K):
    E.append(S[i+K]-S[i])

print('{:.12f}'.format(max(E)))

S, T = map(str ,input().split(' '))
A, B = map(int ,input().split(' '))
U = input()

dct = {S:A, T:B}
dct[U] = dct[U] - 1
print(dct[S], dct[T])

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t = input().split()
a,b = map(int,input().split())
u = input()
print(a,b-1 if u == t else a-1,b)

s,t = input().split()
a,b = map(int,input().split())
u = input()
print(a if u == t else a-1, end = " ")
print(b-1 if u == t else b)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t=map(str,input().split())
a,b=map(int,input().split())
ss=input()
if ss=="s":
  a-=1
else:
  b-=1
print(a,b)

s,t=map(str,input().split())
a,b=map(int,input().split())
ss=input()
if ss="s":
  a-=1
else:
  b-=1
print(a,b)


s,t=map(str,input().split())
a,b=map(int,input().split())
ss=input()
if ss==s:
  a-=1
else:
  b-=1
print(a,b)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = A2 + ' ' + B2

print(output)


inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = "{} {}".format(A2, B2)

print(output)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#! env/bin/local python3

s, t = input().split()
a, b = map(int, input().split())
u = int(input())

balls = {
    s: a,
    t: b
}

balls[u] -= 1

print(f'{balls[s]} {balls[t]}')


#! env/bin/local python3

s, t = input().split()
a, b = map(int, input().split())
u = input()

balls = {
    s: a,
    t: b
}

balls[u] -= 1

print('{} {}'.format(balls[s], balls[t]))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t = input().split()
a,b = (int(x) for x in input().split())
u = input()

if u==s:
    print(a-1)
elif u==t:
    print(b-1) 

s,t = input().split()
a,b = (int(x) for x in input().split())
u = input()

if u==s:
    print(a-1)
elif u==t:
    print(b-1) 

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

if u == s[0]:
    a -= 1
else:
    b -= 1

print(a,b)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

import numpy as np
def main():
    S,T = input().split()
    A,B = MAP()
    U = input()

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

    return

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
import sys
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

import numpy as np
def main():
    S,T = input().split()
    A,B = MAP()
    U = INT()

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

    return

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
import sys
# input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    S,T = input().split()
    A,B = MAP()
    U = input()

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

    return

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=input().spit()
d={}
d[a]=0
d[b]=0
d[a],d[b]=map(int,input().split())
x=input()
d[x]-=1
print(d[a],d[b])

a,b=input().split()
d={}
d[a]=0
d[b]=0
d[a],d[b]=map(int,input().split())
x=input()
d[x]-=1
print(d[a],d[b])


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-
N, K = map(int, input().split())
p = list(map(int, input().split()))
Exp = [0]*(N-K+1)
for i in range(N-K+1):
    x = 0
    for j in range(i, i+K):
        x += (sum(range(1, p[j]+1)))/p[j]
    Exp[i] = x
print(max(Exp))

# -*- coding: utf-8 -*-
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s:
    a -= 1
if u == t:
    b -= 1
print(a, b)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
s,t=iim()
a,b=iim()
u=ii()

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

def ii():return int(input())
def iim():return map(int,input().split())
def ism():return map(str,input().split())
def iil():return list(map(int,input().split()))
s,t=ism()
a,b=iim()
u=input()

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t=map(str,input().split())
a,b=map(int,input().split())
q=input()
print("{x} {y}".format(a-1,b) if q==s else "{x} {y}".format(a,b-1))


s,t=map(str,input().split())
a,b=map(int,input().split())
q=input()
print(a-1,b if q==s else a,b-1)

s,t=map(str,input().split())
q,w=map(int,input().split())
Q=input()
print("{} {}".format(q-1,w) if Q==s else "{} {}".format(q,w-1))
      

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t=map(input().split())
a,b=map(int,input().split())
u=input()
if s==u:
  print(a-1,b)
else:
  print(a,b-1)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
N, K = map(int, input().split(" "))
p = np.array(list(map(int, input().split(" "))))
ex = np.array([(i + 1) / 2 for i in p])
ans = np.sum(ex[0: K])
max_ans = ans
for i in range(K, N):
    diff = ex[i] - ex[i - K]
    ans += diff
    if diff > 0:
        max_ans = ans
print(max_ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s, t = input().split()
a, b = map(int, input().split())
u=input()

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

s, t = input().split()
a, b = map(int, input().split())
u=input()

if(u==s):
  print(str(a-1)+" "+str(b))
else:
 print(str(a)+" "+str(b-1))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t = input().split()
a,b = input().split()
u = input().split()

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


s,t = input().split()
a,b = input().split()
u = input()

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

s,t = input().split()
a,b = input().split()
u = input()

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
color = input().split()
num = input().split()
choice = input()
for i in 2:
  if choice == color[i]:
    num[i] = int(num[i]) - int(color[i])
    
print(num)

color = input().split()
num = input().split()
choice = input()

for i in range(2):
  num[i] = int(num[i])
  if color[i] == choice:
    num[i] = num[i] - 1
print(num[0], num[1])

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t=str(input(),split())
a,b=int(input(),split())
u=str(input())
if u==s:
  a-=1
else:
  b-=1
print(a,b)

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


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S,T=input().split()
A,B=map(int,input().split())
U=input()

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t=map(input().split())
a,b=map(int,input().split())
u  =input()
if s==u:
	print(a-1)
else:
	print(b-1)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
ss=input().split()
a,b=list(map(int,input()))
s=input()
if s==ss[0]: print(a-1,b)
elif s==ss[1]:print(a,b-1)

l=input().split()
for i in l:
  if l.count(i)!=1:
    print("NO")
    exit(0)
print("YES")

ss=input().split()
a,b=list(map(int,input().split()))
s=input()
if s==ss[0]: print(a-1,b)
elif s==ss[1]:print(a,b-1)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
print('x'*len(input()))

s,t = input().split()
a,b = map(int,input().split())
u = input()

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t = input().split()
a,b = input().split()
a = int(a)
b = int(b)
u = input()
  

print(s,t,a,b,u)

if u == s:
	a= a-1

elif u==t:
	b= b-1
  
print(a,b)

s,t = input().split()
a,b = input().split()
a = int(a)
b = int(b)
u = input()

if u == s:
	a= a-1

elif u==t:
	b= b-1
  
print(a,b)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

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


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


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


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())
if S==U:
  print(A-1)
else:
  print(B-1)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b = input().split()
A,B = input().split()
c = input()
a = str(a)
b = str(b)
A = int(A)
B = int(B)
c = str(c)
d = A - 1
D = B - 1
if c == a:
    print(d)
elif c == b:
    print(D)

a,b = input().split()
A,B = input().split()
c = input()
a = str(a)
b = str(b)
A = int(A)
B = int(B)
c = str(c)
d = A - 1
D = B - 1
if c == a:
    print(d,B)
elif c == b:
    print(A,D)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
[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}")


X = input().split()
S = X[0]
T = X[1]
Y = input().split()
A = int(Y[0])
B = int(Y[1])
U = input()
 
A -= 1 if U == S else B -= 1
 
print(str(A) + " " + str(B))

X = input().split()
S = X[0]
T = X[1]
Y = input().split()
A = int(Y[0])
B = int(Y[1])
U = input()

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

print(A + " " + B)

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

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
,

# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(l):
	n = len(l)
	

s,t = map(str, stdin.readline().rstrip().split())
a,b = map(int, stdin.readline().rstrip().split())
u = input()
if(u == s):
	a -= 1
else:
	b -= 1
print(a,b)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t=input().split()
a,b=map(int,input().split())
u=input().split()
if s==u:
  print(str(a-1)+" "+str(b))
else:
  print(str(a)+" "+str(b-1))

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
exp = [sum([(pi + 1) / 2 for pi in p[i:i+k]]) for i in range(n-k+1)]
print(max(exp))

a, b = input().split()
a1, b1 = list(map(int, input().split()))

print(str(a1) + " " + str(b1 - 1) if input() == b else str(a1 - 1) + " " + b1)

a, b = input().split()
a1, b1 = list(map(int, input().split()))

print(str(a1) + " " + str(b1 - 1) if input() == b else str(a1 - 1) + " " + str(b1))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t=input().split()
a,b=map(int,input()split())
u=input()
if u==s:
    a-=1
else:  b-=1
print(a, b)

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

s,t=input().split()
a,b=map(int,input()split())
u=input()
if u==s:
    a--
elif u==t:
    b--
print("{} {}".format(a,b))

s,t=input().split()
a,b=map(int,input()split())
u=input()
if u==s:
    a-=
elif:b-=
print(a, b)

s,t=input().split()
a,b=map(int,input()split())
u=input()
if u==s:
    a--
elif u==t:
    b--
print({} {},format(a,b))

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
moji = list(map(str,input().split()))
kazu = list(map(int,input().split()))
U = input()
print(kazu[moji.index(U)] -1)

moji = list(map(str,input().split()))
kazu = list(map(int,input().split()))
U = input()
kazu[moji.index(U)] -= 1
print(kazu[0],kazu[1])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t = input().split()
ans = map(int,input().split())
m = input()
if m == s:
  ans[0] -= 1
elif m == t:
  ans[1] -= 1
print(ans[0],ans[1])

s,t = input().split()
ans = [int(i) for i in input().split()]
m = input()
if m == s:
  ans[0] -= 1
elif m == t:
  ans[1] -= 1
print(ans[0],ans[1])

Verdicts: Runtime Error

Accepted
Problem: 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.

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

if u == w[0]:
  print(n[0]-1,n[1])
else:
  print(n[0],n[1]-1)

w = list(input().split())
n = list(map(int, input().split()))
u = input()

if u == w[0]:
  print(n[0]-1,n[1])
else:
  print(n[0],n[1]-1)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s,t=input().split()
a,b=input().split()
a=int(a)
b=int(b)
u=input()
dict={}
dict[s]=a
dict[t]=b

dict[u]-=1

for k,v in dict.items():
    print(v,end=' ')

s,t=input().split()
a,b=input().split()
a=int(a)
b=int(b)
u=input()
dict={}
dict[s]=a
dict[t]=b

dict[u]-=1

for k,v in dict.items():
    print(v,end=' ')

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = list(map(str, input().split()))
b = list(map(int, input().split()))
c = list(map(str, input().split()))
if a[0] == c:
	b[0] = b[0] - 1
else: b[1] = b[1] -1
print(b[0],b[1])

a = list(map(str, input().split()))
b = list(map(int, input().split()))
c = list(map(str, input().split()))
if a[0] == c[0]:
	b[0] = b[0] - 1
else: b[1] = b[1] -1
print(b[0],b[1])


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
as. bs = map(str,input().split())
ci, di = map(int,input().split())
es = str(input())

if es == as:
  ca = ci - 1
  print(ca)
elif es == bs:
  da = di -1
  print(da)

fs, bs = map(str,input().split())
ci, di = map(int,input().split())
es = str(input())

if es == fs:
  ca = ci - 1
  print(ca)
elif es == bs:
  da = di -1
  print(da)


A, B = map(str, input().split())
N, M = map(int, input().split())
S = input()

if A == S:
  print(N-1,M)
elif B == S:
  print(N,M-1)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import collections
N = int(input())
A = input().split(' ')

c = max(collections.Counter(A).values())
if c == 1:
	print('YES')
else:
	print('NO')


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

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

print('{} {}'.format(A, B))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#!python3.4
# -*- coding: utf-8 -*-
# abc154/abc154_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S,T = i2s().split()
    A,B = i2nn()
    U = i2s()
    d = {S:A, T:B}
    d[U] -= 1
    print(d[A], d[B])
    return

main()


#!python3.4
# -*- coding: utf-8 -*-
# abc154/abc154_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S,T = i2s().split()
    A,B = i2nn()
    U = i2s()
    d = {S:A, T:B}
    d[U] -= 1
    print(d[S], d[T])
    return

main()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math

import numpy as np
import scipy as scp
import sklearn as skl


s,t = input().split()
a,b = map(int,input().split())
u = input()

dic = {s:a,t:b}

if u == s:
    dic[s] -= 1
else:
    dic[t] -= 1

print(dic[s],dic[t])

import math

import numpy as np
import scipy as scp


s,t = input().split()
a,b = map(int,input().split())
u = input()

dic = {s:a,t:b}

if u == s:
    dic[s] -= 1
else:
    dic[t] -= 1

print(dic[s],dic[t])

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(str,input().split())
c.d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)
 

a,b=map(str,input().split())
c.d=map(int,input().split())
e=input()
if a==e:
  print(c-1,d)
else:
  print(c,d-1)
 

a,b=map(str,input().split())
c.d=map(int,input().split())
e=input()
if c==e:
  print(c-1,d)
else:
  print(c,d-1)
 

a,b=map(str,input().split())
c,d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)
 

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S,T = map(str,input().split())
A,B = map(str,input().split())
U = input()
if U == S:
  print(A-1 B)
else:
  print(A B-1)

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted