TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
str = input().split()
A = int(str[0])
B = int(str[1])
ans = 0
 
if A> B:
  ans = ans + A
else :
  ans = ans + B
  
if A> B:
  ans = ans + A
  A = A-1
else :
  ans = ans + B
  B = B-1
  
print(ans)

A = input()
B = input()
A = int(A)
B = int(B)
ans = 0

if A> B:
  ans = ans + A
else :
  ans = ans + B
  
if A> B:
  ans = ans + A
else :
  ans = ans + B
  
print(ans)


str = input().split()
A = int(str[0])
B = int(str[1])
ans = 0
 
if A> B:
  ans = ans + A
  A = A-1
else :
  ans = ans + B
  B = B-1
if A> B:
  ans = ans + A
else :
  ans = ans + B
  
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,input());ans=0
if a<b:ans+=b;b-=1
else:ans+=a;a-=1
ans+=max(a,b)
print(ans)

a,b=map(int,input().split())
if a==b:print(a*2)
else:print(max(a,b)*2-1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

print(max(a-1+b,b-1+a,a+b))

a,b=map(int,input().split())

print(max(a-1+a,b-1+b,a+b))

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=[int(i) for i in input().split()]
if a==b:
  print(a**2)
else:
  print(max(a,b)*max(a-1,b-1))

a,b=[int(i) for i in input().split()]
if a==b:
  print(2*a)
else:
  print(max(a,b)+(max(a,b)-1))

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):

A, B = map(int, input().split())
cnt = 0
for n in range(2):
    if A > B:
        cnt += A
        A -= 1
    elif A < B:
        cnt += B
        B -= 1
    else:
        cnt += A 
        A -= 1

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

cnt = 0
for n in range(2):
    if A > B:
        cnt += A
        A -= 1
    elif A < B:
        cnt += B
        B -= 1
    else:
        cnt += A 
        A -= 1

print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a, b = [int(x) for x in input()]
print(max(a + a - 1, a + b, b + b - 1))

a, b = [int(x) for x in input().split()]
print(max(a + a - 1, a + b, b + b - 1))


Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
n = int(input())
h = [int(a) for a in input().split()]

result = 0
for i in range(n):
    if all([h[j] <= h[i] for j in range(i)]):
        result += 1

print(result)


a, b = [int(x) for x in input().split()]

c = max([a, b])

if c == a:
    d = max([a - 1, b])
else:
    d = max([a, b - 1])

result = c + d
print(result)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
 S = A + B

print(x)

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
  x = A + B

print(x)

A, B = map(int, input().split())
x = 0

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
  x = A + B

print(x)

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

if A - B >= 2:
  print(2 * A - 1)
elif B - A >= 2:
  print(2 * B - 1)
else:
  print(A + B)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

a,b=map(int,input().split())
if a==b:
  print(2*a)
else:
  if a<b:
    print(b*(b-1))
  else:
    print(a*(a-1))

a,b=map(int,input().split())
if a==b:
  print(2*a)
else:
  if a<b:
    print(b+(b-1))
  else:
    print(a+(a-1))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
N = int(input())
H = list(map(int, input().split()))
result = 1

for i in range(N):
    dec = True
    for j in range(i-1):
        if H[i] <= H[j]:
            dec = False
            break
    if dec == True:
        result += 1
print(result)

N = int(input())
H = list(map(int, input().split()))
result = 0

for i in range(N):
    dec = True
    for j in range(i-1):
        if H[i] <= H[j]:
            dec = False
            break
    if dec == True:
        result += 1
print(result)

A, B = list(map(int, input().split()))
result = 0
A, B = max(A, B), min(A, B)
result += A + max(A-1, B)
print(result)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
n=list(int(input()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)

n=list(int(input().split()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)

n=list(map(int,input().split()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=input().split()
a=int(a)
b=int(b)
if a-b>=2:
  print(2a-1)
if b-a>=2:
  print(2b-1)
else:
  print(a+b)

a,b=input().split()
a=int(a)
b=int(b)
if a-b>=2:
  print(2*a-1)
if b-a>=2:
  print(2*b-1)
else:
  print(a+b)

a,b=input().split()
a=int(a)
b=int(b)
if a-b>=2:
  print(2*a-1)
if b-a>=2:
  print(2*b-1)
if -2<a-b<2:
  print(a+b)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A = input()
B = input()

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)

A = input()
B = input()

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)


A = input()
B = input()

if A < B :
    X = A
    A = A - 1
else :
    X = B
    B = B - 1
if A > B :
    X = X + A
else :
    X = X + B

print(X)

A,B, = map(int,(input().split(" ")))
X = int(0)
for i in range(2):
        if(A>=B):
                X += A
                A = A - 1
        else:
                X += B
                B = B-1
print(X)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
s = input()
n = len(s)
count = 0
count2 = 0
for i in range(n):
    if i % 2 == 0:
        x = "0"
    else:
        x = "1"
    if s[i] == x:
        count2 += 1
        #print(i, s[i], x, "OK")
    else:
        count += 1
        #print(i, s[i], x)
print(min(count,count2))

a, b = map(int, input().split())
if a > b:
    print(a + a - 1)
else:
    if a == b:
        print(a + b)
    else:
        print(b + b - 1)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,input().split())
c=max(a,b)
print(c+max(a-1,b-1,c))


a,b=map(int,input().split())
if a==b:print(2*a)
else:print(max(a,b)+max(a-1,b-1))


Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int, input().split())
if a==b:
  print(a*2)
else:
  print(max([a,b])*2-1

a,b=map(int, input().split())
if a==b:
  print(a*2)
else:
  print(max([a,b])*2-1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b = list(map(int, input().split()))
if a == b:
  print(2 * a)
else:
  printf(max(a,b) * 2 - 1)

    a,b = list(map(int, input().split()))
    if a == b:
      print(2 * a)
    else:
      print(max(a,b) * 2 - 1)

a,b = list(map(int, input().split()))
if a == b:
	print(2 * a)
else:
	print(max(a,b) * 2 - 1)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
n = int(input())
h = [int(i) for i in input().split()]
ans = 1
for i in range(n):
    if h[i-1] < h[i]:
        if h[0] == max(h):
            break
        ans += 1

print(ans)

import sys
a,b=map(int,input().split())
ans = max(a,b)
if a == b:
    print(a+b)
    sys.exit()

print(ans+(ans-1))

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A,B =map(int,input().split())
l =[A,A-1,B,B-1]
l.sort()
print(l[0]+l[1])

A,B =map(int,input().split())
l =[A,A-1,B,B-1]
l.sort()
print(l[2]+l[3])

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b = map(int, inptu().split())
if a == b:
    print (a*2)
else:
    print (max(a,b)*2-1)

a,b = map(int, input().split())
if a == b:
    print (a*2)
else:
    print (max(a,b)*2-1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A, B = map(int, input().split())
max(A*2-1, A + B, B*2-1)

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

print (max(A+B, 2*A-1, 2*B-1))

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
l = sorted([int(input()) for i in range(2)])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
elif: l[1] == l[0]:
  print(l[0]*2)
else:
  print(l[0]+l[1]-1)

l = sorted([int(input()) for i in range(2)])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
else:
  print(l[0]+l[1])

l = sorted([int(input)) for i in range(2)])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
elif: l[1] == l[0]:
  print(l[0]*2)
else:
  print(l[0]+l[1]-1)

  
  

l = sorted([int(i) for i in input().split()])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
else:
  print(l[0]+l[1])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
s = list(input())

prev = s[0]
count  = 0
for i in range(1, len(s)):
    if prev == s[i]:
        count += 1

        if prev == '0':
            s[i] = '1'
        else:
            s[i] = '0'

    prev = s[i]

print(count)

a, b = map(int, input().split())

if a == b:
    print(a + b)
else:
    print(2 * max([a, b]) - 1)


Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

print(max(x, y) + max(max(x, y)-1, min(x,y))

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

print(max(x, y) + max(max(x, y)-1, min(x,y))


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

print(max(x, y) + max(max(x, y)-1, min(x,y)))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,iput().split())

if a>b or a==b:
  print(2*a-1)
else:
  print(2*b-1)

a,b=map(int,input().split())

if a==b:
  print(a+b)
elif a>b:
  print(2*a-1)
else:
  print(2*b-1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A, B= map(int, input().split())
sum = 0
i=0
while i < 2:
    if A => B:
        sum += A
        A -= 1
    else:
        sum+= B
        B -= 1
    i +=1

print(sum)

A, B= map(int, input().split())
sum = 0
i=0
while i < 2:
    if A >= B:
        sum += A
        A -= 1
    else:
        sum+= B
        B -= 1
    i +=1

print(sum)


Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b = map(int,input().split())
if abs(a-b) < 2:
  print(a+b)
else:
  print(2*max(a,b) + 1)

a,b = map(int,input().split())
if abs(a-b) < 2:
  print(a+b)
else:
  print(2*max(a,b) - 1)


Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a = input().split()
b = int(d[0])
c = int(d[1])
if b > c:
	first = b
    b = b - 1
else:
	first = c
	c = c - 1
if b > c:
	second = b
else:
	second = c
answer = first + second
print(str(answer))


a = input().split()
b = int(a[0])
c = int(a[1])
if b > c:
	first = b
	b = b-1
else:
	first = c
	c = c-1
if b > c:
	second = b
else:
	second = c
answer = first + second
print(str(answer))

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b = map(int,input().split())
ans = max(a,b)
if min(a,b)>max(a.b)-1:
  ans+=min(a,b)
else:
  ans+=max(a,b)-1
print(ans)  


a,b = map(int,input().split())
ans = max(a,b)
if min(a,b)>max(a,b)-1:
  ans+=min(a,b)
else:
  ans+=max(a,b)-1
print(ans)   

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
import sys


def main(argv):
    a = argv[0]
    b = argv[1]
    _sum = 0
    for i in range(2):
        if a > b:
            sum += a
            a -= 1
        else:
            sum += b
            b -= 1
    print(_sum)


if __name__ == '__main__':
    main(sys.argv[1:])


num = input()
num_list = num.split()
a = int(num_list[0])
b = int(num_list[1])
_sum = 0
for i in range(2):
    if a > b:
        _sum += a
        a -= 1
    else:
        _sum += b
        b -= 1
print(_sum)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):

def main():
    A = int(input())
    B = int(input())

    ans = 0
    if A < B:
        ans += B
        B = B - 1
    else:
        ans += A
        A = A - 1

    if A < B:
        ans += B
        B = B - 1
    else:
        ans += A
        A = A - 1

    print(ans)

    return

if __name__ == '__main__' :
    main()



def main():
    A,B = list(map(int, input().split()))

    ans = 0
    if A < B:
        ans += B
        B = B - 1
    else:
        ans += A
        A = A - 1

    if A < B:
        ans += B
        B = B - 1
    else:
        ans += A
        A = A - 1

    print(ans)

    return

if __name__ == '__main__' :
    main()



Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

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

# stand = []
# reverse = []
# state = None
# count = 0
# tmp = None


# 		state = "stand"
# 	else:
# 		state = "reverse"
# 	if tmp == "stand" and state == "reverse":
# 		stand.append(count)
# 		count = 1
# 	elif tmp == "reverse" and state == "stand":
# 		reverse.append(count)
# 		count = 1

# 		count += 1
# 	tmp = state
# if state == "stand":
# 	stand.append(count)
# else:
# 	reverse.append(count)

# if "0" not in S:
# 	print(len(S))
# else:

# 		print(len(S))
# 	else:
# 		if len(stand) > len(reverse):
# 			reverse.append(0)
# 			reverse.insert(0, 0)
# 		if len(stand) == len(reverse) and S[0] == "0":
# 			reverse.insert(0, 0)
# 		if len(stand) == len(reverse) and S[0] == "1":
# 			reverse.append(0)
# 		# print(stand)
# 		# print(reverse)
# 		max_ = 0

# 			# print(reverse[i:i+K+1],stand[i:i+K])
# 			tmp = sum(reverse[i:i+K+1]+stand[i:i+K])
# 			if tmp > max_:
# 				max_ = tmp
# 		print(max_)

indexes = []
tmp = ""
for i in range(len(S)):
	if S[i] == "0":
		state = "stand"
	else:
		state = "reverse"
	if tmp != state:
		indexes.append(i)
	else: 
		pass
	tmp = state
indexes.append(N)
ans = []
# print(indexes)
for i in range(len(indexes)):
	# print(i)
	if S[indexes[i]] == "0":
		if i+2*K >= len(indexes):
			pass
		ans.append(indexes[i+2*K]-indexes[i])
	else:
		if i+2*K+1 >= len(indexes):
			pass
		ans.append(indexes[i+2*K+1]-indexes[i])
if ans == []:
	print(len(S))
else:
	print(max(ans))

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B = MAP()

print(max(A+A-1,A+B, B+B-1))

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A,B = (int(i) for i in input().split()) 

if A >= B+1 :
   print( '%d' % 2*A-1 )
elif B >= A+1 :
   print( '%d' % 2*B-1 )
else:
   print( '%d'% 2*A)

A,B = (int(i) for i in input().split()) 
C=0
if A >= B+1 :
	C=2*A-1
	print( '%d' % C  )
elif B >= A+1 :
	C=2*B-1
	print( '%d' % C )
else:
	C=2*A
	print( '%d'% C)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b = map(int,input())
point = 0
point += max(a,b)

if max(a,b) == a:
  point += max(a-1,b)
  print(point)
else:
  point += max(a,b-1)
  print(point)

a,b = map(int,input().split())
point = 0
point += max(a,b)

if max(a,b) == a:
  point += max(a-1,b)
  print(point)
else:
  point += max(a,b-1)
  print(point)


Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,input().split())
if a>b and a-b>2:
  print(2*a-1)
elif a>b and a-b<2:
  print(a+b)
elif b>a and b-a>2:
  print(2*b-1)
elif b>a and b-a<2:
  print(a+b)
elif a==b:
  print(a+b)

a,b=map(int,input().split())
p=[2*a-1, 2*b-1, a+b]
print(max(p))

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a = sorted(list(map(int, input().split())))
if a[2]-a[1]>=1:
  print(a[2]*2-1)
elif a[2]-a[1]=0:
  print(a[2]*2)

a = sorted(list(map(int, input().split())))

a = sorted(list(map(int, input().split())))
if a[1]-a[0] >= 1:
  print(a[2]*2-1)
else:
  print(a[2]*2)

a = sorted(list(map(int, input().split())))
if a[2]-a[1]>=1:
  print(a[2]*2-1)

a = sorted(list(map(int, input().split())))
if a[1]-a[0] >= 1:
  print(a[1]*2-1)
else:
  print(a[1]*2)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,input().split())
if a - b == 0 or 1 or -1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1)

a,b=map(int,input().split())
if a - b == 0 or 1 or -1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1

a,b=map(int,input().split())
if abs(a - b) <= 1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

answer = 0
if A >= B:
  answer += A
  A -= 1
else:
  answer += B
  B -= 1
answer = 0
if A >= B:
  answer += A
else:
  answer += B

print(answer)

A, B = map(int, input().split())
 
answer = 0
if A >= B:
  answer += A
  A -= 1
else:
  answer += B
  B -= 1
if A >= B:
  answer += A
else:
  answer += B
 
print(answer)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a, b = map(int, input())
print(max(a + a - 1, a + b))

a, b = map(int, input().split())
print(max(max(a, b) + max(a, b) - 1, a + b))

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a, b = map(int, input().split())
if a == b:
    print(2*a-1)
else:
    print(a+b)


a, b = map(int, input().split())
if a == b:
    print(2*a)
else:
    print(max(a, b)*2-1)


Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A, B = map(int, input().split())
if A == B:
  print(A*2)
else:
  print(max(A, B)*2)

A, B = map(int, input().split())
if A == B:
  print(A*2)
else:
  print(max(A, B)*2-1)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
m=int(input())
a=list(map(int,input().split()))
D=1
n=1

while n < m:
 if a[n] < max(a[0:n]):
  D=D 
  n=n+1
 else:
  D=D+1 
  n=n+1

print(D)

a,b=map(int,input().split())
print(max(a+a-1,a+b,b+b-1))

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=int(input())
if a-1=>b:
  print(2*a-1)
elif a==b:
  print(2a)
else:
  print(2*b-1)

a,b=map(int,input().split())
if a-1>=b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
M,N = [int(x) for x in input()]
print(M+N if M==N else 2*max(M,N)-1)

M,N = [int(x) for x in input().split()]
print(M+N if M==N else 2*max(M,N)-1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a = list(map(int, input().split()))
a.append(a[0]-1)
a.append(a[1]-1)
a.sort()
pirnt(a[-1]+ a[-2])



a,b = map(int, input().split())
if a == b:
  print(a + b)
else:
  c = max(a,b)
  print(c * 2 - 1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
n = int(input())
h = list(map(int, input().split()))
c = 1
for i in range(1,n):
    if h[i] >= max(h[j] for j in range(i)):
        c += 1
print(c)

a, b = map(int, input().split())

count = 0
for i in range(2):
    if a < b:
        count += b
        b -= 1
    else:
        count += a
        a -= 1

print(count)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,input().split())
print(max(a,b)+print(max(max(a,b)-1,min(a,b)))

a,b=map(int,input().split())
print(max(a,b)+max((max(a,b)-1),min(a,b)))

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A, B = map(int, input().split())
print(max(a, b) * 2 - 1)

# coding: utf-8
A, B = map(int, input().split())
if A == B:
    print(A * 2)
else:
    print(max(A, B) * 2 - 1)


Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a, b = [int(x) for x in input().split()]
print(max(a+b, max(a*2, b*2)))

a, b= [int(x) for x in input().split()]
print(max(a+b, max(a+a-1, b+b-1)))

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a=input()
b=input()
sum=0
a=int(a)
b=int(b)
 
if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)

import numpy as np

a=input()
b=input()
sum=0

if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b:
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)
  

import numpy as np
 
a,b=(int(x) for x in input().split())
sum=0

 
if a>=b:
  sum+=a
  if a-1>=b:
  	sum+=a-1
  else:
    sum+=b
else:
  sum+=b
  if b-1>=a:
  	sum+=b-1
  else:
    sum+=a
    
print(sum)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
N, K = [int(i) for i in input().split()]
s = input()
S = [int(s[i]) for i in range(len(s))]

for i in range(K):
    pair = []
    temp = 0
    for i in range(N):
        if i <= N-1:
            if (S[i]==0 and S[i+1]==0):
                temp += 1
            elif(S[i]==0):
                pair.append([i-temp,temp])
                temp = 0
        else:
            if(S[i]==0):
                pair.append([i,temp])
                temp = 0
    max_m = 0
    max_s = []
    for i in range(len(pair)):
        temp = S.copy()
        s, l = pair[i]
        for j in range(l+1):
            temp[s+j]=1
        m = cal_l(temp, N)
        if (m > max_m):
            max_m = m
            max_s = temp.copy()
    S = max_s.copy()
print (max_m)

inputs = [int(i) for i in input().split()]
res = 0
res += max(inputs)
max_idx = inputs.index(max(inputs))
inputs[max_idx] -= 1
res += max(inputs)
print (res)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
ab = input().split()
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

ab = input().split()
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

ab = input().split()
ab[0] = int(ab[0])
ab[1] = int(ab[1])
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A,B=list(map(int,input().split()))
C=0
for i in range(1):
    if A>B:
        C+=A
        A=A-1
    else:
        C+=B
        B=B-1
print(C)

A,B=list(map(int,input().split()))
C=0
for i in range(2):
    if A>B:
        C+=A
        A=A-1
    else:
        C+=B
        B=B-1
print(C)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b=map(int,input().split())
print(max(a*(a-1),(a-1)*b,a*(b-1),b*(b-1)))

a,b=map(int,input().split())
print(max(a+(a-1),a+b,b+(b-1)))

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

S = str(input())

ans=0

if len(S)==1:
  ans=0
elif len(S)==2:
  if S[0]==S[1]:
    ans=1
  else:
    ans=0
else: 
  strint=[]
  original_string=[]
  
  for i in range(len(S)):
    string.append(S[i])
    original_string.append(S[i])
    
  for i in range(len(S)-2):
    gramed = str(string[i])+str(string[i+1])+str(string[i+2])
    
    if gramed=="000":
      string[i+1]="1"
    if gramed=="001":
      string[i]="1"
    if gramed=="011":
      string[i+2]="0"
    if gramed=="110":
      string[i]="0"
    if gramed=="100":
      string[i+2]="1"
    if gramed=="111":
      string[i+1]="1"
  
  #print(string)
  #print(original_string)
  
  for i in range(len(S)):
    if original_string[i]!=string[i]:
      ans=ans+1
  
print(ans)

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


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

ans=max((A)+(A-1),A+B,B+(B-1))

print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A = int(input())
B = int(input())


if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

A = int(input("数字を入力してください:"))
B =int(input("数字を入力:"))

if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

A = int(input())
B = int(input())


if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)


A = int(input())
B =int(input())

if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)



button = input().split()
A = int(button[0])
B = int(button[1])


if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
A,B = map (int, input ().split ())
p = 0
for i in range (2):
  if A > B:
    p += A
  else:
    p += B
print (p)

A,B = map (int, input ().split ())
p = 0
for i in range (2):
  if A > B:
    p += A
    A -= 1
  else:
    p += B
    B -= 1
print (p)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a = int (input())
b = [int(a) for a in input().split()]
count=1
count1=0
le = len(b)-1

for i in range(le):
    if(b[i]<=b[i+1] and b[0]<=b[i+1] ):
        count=count+1
print(count)


a = [int(e) for e in input().split()]

if(a[0]<=a[1]):
    tmp=a[1]
    a[1]=a[1]-1
else:
    tmp=a[0]
    a[0]=a[0]-1

if(a[0]<=a[1]):
    tmp1=a[1]
    a[1]=a[1]-1
else:
    tmp1=a[0]
    a[0]=a[0]-1

print(tmp+tmp1)


Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

total =0

for i in range(2):
    if a >= b:
        total+=a
    else:
        total+=b

print(total)

a,b = map(int, input().split())

total =0

for i in range(2):
    if a >= b:
        total+=a
        a-=1
    else:
        total+=b
        b-=1

print(total)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
a,b = input().split()
if a == b:
  print(a*2)
else:
  print(max(a,b)*2-1)


a,b = map(int,input().split())
if a == b:
    print(a*2)
else:
    c = max(a,b)
    d = c*2-1
    print(d)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

# x = sorted([a, b, a - 1, b - 1], reverse=True)
# print(x[0] + x[1])

if a > b:
	print(a * (a - 1))
elif b > a:
  	print(b * (b - 1))
else:
	print(a + b)

a, b = map(int, input().split())

# x = sorted([a, b, a - 1, b - 1], reverse=True)
# print(x[0] + x[1])

if a > b:
	print(a + (a - 1))
elif b > a:
  	print(b + (b - 1))
else:
	print(a + b)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
S = input()
odd = S[1::2]
even = S[::2]
print(min(odd.count("1") + even.count("0"), even.count("1") + odd.count("0")))

A, B = map(int, input().split())
if A - B >= 2:
    print(A+A-1)
elif B - A >= 2:
    print(B+B-1)
else:
    print(A+B)

Verdicts: Wrong Answer

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

Submission attempts (in order):
N,K = map(int,input().split())
s = list(map(int,input()))
s.append(2)
start = s[0]
choku = [0]
saka = [0]
number = 1
for i in range(N):
    if s[i] == s[i+1]:
        number += 1
    else:
        if s[i] == 0:
            choku.append(number)
            number = 1
        else:
            saka.append(number)
            number = 1
choku.append(0)
saka.append(0)
while(1):
    max_align = 0
    m = len(choku)
    n = len(saka)
    if m <= K:
        print(N)
        break
    if start == 0: 
        for i in range(m-K+1):
            if max_align <= sum(choku[i:i+K]) + sum(saka[i-1:i+K]):
                max_align = sum(choku[i:i+K]) + sum(saka[i-1:i+K])
    else:
        for i in range(m-K+1):
            if max_align <= sum(choku[i:i+K]) + sum(saka[i:i+K+1]):
                max_align = sum(choku[i:i+K]) + sum(saka[i:i+K+1])
    print(max_align)
    break

A,B = map(int,input().split())
if A == B:
  print(2 * A)
elif A > B:
  print(2 * A -1)
else:
  print(2 * B -1)

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

v1, v2 = map(int, input().split())

if v1 < v2:
    t = v1
    v1 = v2
    v2 = t

v3 = v1 - v2

if v3 = 0:
    print(v1*2)

if v3 <= 2:
    print(v1*2-1)

if v1 == 1:
    print(v1*2+1)

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

Verdicts: Runtime Error

Accepted
Problem: There are two buttons, one of size A and one of size B.  When you press a button of size X, you get X coins and the size of that button decreases by 1.  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?

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

ans=0
if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

print(ans)X

a, b = map(int, input().split())

ans=0
if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

print(ans)

Verdicts: Runtime Error

Accepted