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

if A >= B: print(2*A)
else: print(2*B)

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

if A >= B: print(2*A)
elif: print(2*B) 
  

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

if A > B: print(2*A-1)
elif A == B: print(2*A)
else: print(2*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())

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

A,B = map(int,input().split())
 
if A>B:
	print(A*2-1)
elif A==B:
	print(A+B)
else:
	print(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):
if A >= B+2:
    n = 2*A - 1
elif A <= B-2:
    n = 2*B - 1
else:
    n = A+B
    
print(n)

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

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

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().rstrip().split())
if A == B:
    print(A*A)
else:
    print(max(A,B) + (max(A,B) - 1)

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

A,B = map(int,input().rstrip().split())
if A == B:
    print(A + A)
else:
    print(max(A,B) + (max(A,B) - 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):
q, k = list(map(int, input().split()))
list = [int(i) for i in input()]


sum01 = []
pre = 1
cnt = 0
# 111010
# 001010
for i, e in enumerate(list):
    if e != pre:
        sum01.append(cnt)
        cnt = 1
        pre = e
    else:
        cnt += 1
if cnt != 0:
    sum01.append(cnt)

if len(sum01) % 2 == 1:
    sum01.append(0)

# print(sum01)
Add = 2 * k + 1
ruiseki = [0]
for i, e in enumerate(sum01):
    ruiseki.append(ruiseki[i] + sum01[i])


answer = 0
for i in range(0, len(ruiseki), 2):
    left = i
    right = min(i + Add, len(sum01))
    temp = ruiseki[right] - ruiseki[left]
    answer = max(temp, answer)

n = list(map(int, input().split()))
if n[0] == n[1]:
    print(n[0] * 2)
else:
    print(max(n) + max(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,B = map(int, input().split())
print(max(2*a-1, 2*b-1, a+b))

a,b = map(int, input().split())
print(max(2*a-1, 2*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+2:
  2*A+1
elif B>=A+2:
  2*B+1
else:
  A+B

A, B = map(int,input().split())
if A>B:
  print(2*A-1)
elif B>A:
  print(2*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):
A, B = map(int,input().split())

if A > B:
    print(A* 2)
else:
    print (B * 2)

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

if A > B:
    print(A * 2 - 1)
elif A == B :
    print (A*2)
else:
    print (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=A
b=B
if a>=b and a-1>=b:
	print(a+a-1)
elif a>=b and a-1<b:
	print(a+b)
elif a<b and a<b-1:
	print(b+b-1)
else:
	print(a+b)


A=11
B=3
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)


if A>=B and A-1>=B:
	print(A+A-1)
elif A>=B and A-1<B:
	print(A+B)
elif A<B and A<B-1:
	print(B+B-1)
else:
	print(A+B)


ipt=input()
lst=ipt.split()
A=lst[0]
B=lst[1]
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)


if A>=B and A-1>=B:
  print(A+A-1)
 	elif A>=B and A-1<B:
      print(A+B)
  	elif A<B and A<B-1:
      print(B+B-1)
    else:
      print(A+B)

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

print(Ans)


Verdicts: Runtime Error

Wrong Answer

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

ans=0

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

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

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

a,b=int(input())

ans=0

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

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

ans=0

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

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

if a==b:
  print(2*a)
  
else:
  print(2*max(a,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())
ab=[a,(a-1),b,(b-1)]
ab.reverse()
print(ab[0]+ab[1])

a,b=map(int,input().split())
ab=[a,(a-1),b,(b-1)]
ab.sort()
print(ab[2]+ab[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, input())
print(max(A, B)+max(A, B)-1)

A, B = map(int, input().split())
if A==B:    
    print(max(A, B)+max(A, B))
else:
    print(max(A, B)+max(A, 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())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            if ListH[k] < ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

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

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

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
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*B,B*(B-1)))


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


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


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,b = map(int, input().split())
if a>=b:
  x = a
else:
  x = b
  
int(x)
print(2*x+1)

N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  if H[i+1]>=H[i] and H[1]<=H[i+1] and H[2]<=H[i+1]:
    ans += 1
print(ans+1)

N = int(input())
H = list(map(int, input().split()))
ans = 0
max = H[0]
for i in range(N-1):
  if H[i] >= max:
    ans += 1
    max = H[i]
print(ans+1)


N = int(input())
H = list(map(int, input().split()))
ans = 0
max = H[1]
for i in range(N-1):
  if H[i+1] >= max:
    ans += 1
    max = H[i+1]
print(ans+1)

N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  if H[i+1] >= H[i]:
    ans += 1
print(ans+1)

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

Verdicts: Wrong Answer

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())
s = max(2*a,2*b,a+b)
if s == 2 *a or s==2*b and 2*a != a+b and 2*b != a+b
    print(s-1)
else:
    print(s)

a,b = map(int,input().split())
if a >b:
    print(2*a-1)
elif a == b:
    print(a+b)
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())
s=0
for i in range(2):
  if a<=b:
    s+=b
    b-1
  else:
    s+=a
    a-1
    
print(s)

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

else:
  print(a+a-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):
s = list(input())

count = 0

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

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

print(count)

s = list(input())

count = 0

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

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

print(count)

s = list(input())

count = 0

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

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

print(count)

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

A = a + b
B = a + a - 1
C = b + b - 1

L = [A, B, C]

print(max(L))

Verdicts: Wrong Answer

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):
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

if A == B:
  print(A + B)
 elif A > B and (A - B) == 1:
  print(A + (A -1))
 elif A > B and (A - B) >= 2:
  print(A + (A - 1))
 elif A < B and (B - A) == 1:
  print(A + B)
 elif A < B and (B - A) >= 2:
  print(B + (B -1))

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

if A == B:
  print(A + B)
elif A > B and (A - B) == 1:
  print(A + (A -1))
elif A > B and (A - B) >= 2:
  print(A + (A - 1))
elif A < B and (B - A) == 1:
  print(A + B)
elif A < B and (B - A) >= 2:
  print(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())

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

A,B =map(int,input().split())
 
print(max(A*2-1,A+B,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(n) for n in input().split()]
ans = 0
for i in range(2):
  ans += A if A >= B else B
print(ans)


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


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(input())
if(a>b):
  print(2*a-1)
else if(a=b):
  print(2*a)
else:
  print(2*b-1)

a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
else if(a=b):
  print(2a)
else:
  print(2b-1)

a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
else if(a=b):
  print(2a)
else:
  print(2b-1)


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

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

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

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


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

a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
elif(a=b):
  print(2a)
else:
  print(2b-1)


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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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())
print('max(a+b, 2a-1, 2b-1)')

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

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

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

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

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

total = 1
flag = True
    
for i in range(1,len(height)):

    for j in range(i):
        if height[i] >= height[j]:
            flag = True
        else:
            flag = False
    
    if flag:
        total += 1

print(total)


number = input()

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

total = 1
flag = True
    
for i in range(1,len(height)):

    for j in range(i):
        if height[i] >= height[j]:
            flag = True
        else:
            flag = False
    
    if flag:
        total += 1

print(total)


n = input()
h = list(map(int,input().split()))

total = 0
maxN = 0
for num in h:
  if  num >= maxN:
    total += 1
  
  maxN = max(maxN,num)

print(total)

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

total = 0

if a >= b :
    total = a
    a -= 1
else:
    total = b
    b -=  1

if a>= b :
    total = total + a
else:
    total = total + b

print(total)

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　+　B)
elif A > B:
  print(A　*　2　-　1)
else:
  print(B　*　2　-　1)

A, B = map(int, input().split())
if A == B:
  print(A+B)
elif A > B:
  print(A*2-1)
else:
  print(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):
n,k=map(int,input().split())
s=input()
lst=[1]
for i in range(1,n):
    if s[i]!=s[i-1]:
        lst.append(1)
    else:
        lst[-1]=lst[-1]+1
p=2*k
L=[0]
for i in lst:
  L.append(L[-1]+i)
l=len(L)
ans=0
if s=='1'*n:
    ans=n
else:
    if s[0]=='1':
        if l%2==0:
            q=(l-p)//2
            for i in range(q):
                ans=max(ans,L[2*i+p+1]-L[2*i])
        else:
            L.append(0)
            q=(l-p+1)//2
            for i in range(q):
                ans=max(ans,L[2*i+p+1]-L[2*i])
    else:
        L.insert(0,0)
        if l%2==1:
            L.insert(0,0)
            q=(l-p+1)//2
            for i in range(q):
                ans=max(ans,L[2*i+p+1]-L[2*i])
        else:
            L.append(0)
            q=(l-p+2)//2
            for i in range(q):
                ans=max(ans,L[2*i+p+1]-L[2*i])
print(ans)
    


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

a,b=map(int,input().split())
print(max(a+a-1,a+b,b+b-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 = list(map(int,input().split()))

SUM = 0
for i in range(2):
  if A >= B:
    SUM = SUM + A
    A -= A
  else:
    SUM = SUM + B
    B -= B
  
print(SUM)    

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

SUM = 0
for i in range(2):
  if A >= B:
    SUM = SUM + A
    A = A - 1
  else:
    SUM = SUM + B
    B = B - 1

print(SUM)   


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(2*A)
elif B > A:
    print(2*B)
else:
    print(2*A)
    

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

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):
def main():
    n, k = map(int, input().split())
    s = input()
    
    arr = []
    if s[0] == '0':
        arr.append(0)
    cnt = 1
    i = 1
    while i != n:
        if s[i] != s[i - 1]:
            arr.append(cnt)
            cnt = 1
        else:
            cnt += 1
        i += 1
    arr.append(cnt)
    if s[-1] == '0':
        arr.append(0)
    
    ans = 0
    curr = arr[0]
    j = 1
    if len(arr) - 1 <= 2 * k:
        print(n)
        return 0
    for i in range(1, len(arr), 2):
        curr += arr[i] + arr[i + 1]
        if i - j == 2 * k:
            curr -= arr[j] + arr[j - 1]
            j += 2
        ans = max(ans, curr)
    print(ans)
    return 0
main()

def main():
    a, b = map(int, input().split())
    ans = 0
    if a > b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1
    print(ans + max(a, b))
    return 0
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):
N,K=map(int,input().split())
S=input()
First=S[0]
Now=First
cnt=0
A=[0]
for s in S:
    if Now=='1' and s=='0':
        A+=[cnt]
        Now='0'
    elif Now=='0' and s=='1':
        A+=[cnt]
        Now='1'
    cnt+=1
A+=[N]
dp=2*K+1
ans=[]

if First=="0":
    p=1
    ans.append(A[min(dp-1,len(A)-1)])
else:
    p=0
    ans.append(A[min(dp,len(A)-1)])

while p+dp<len(A):
	ans.append(A[p+dp]-A[p])
	p+=2

print(A)
print(max(ans))

N,K=map(int,input().split())
S=input()
First=S[0]
Last=S[N-1]

Now=First
cnt=0
A=[0,0]
for s in S:
    if Now=='1' and s=='0':
        A+=[cnt]
        Now='0'
    elif Now=='0' and s=='1':
        A+=[cnt]
        Now='1'
    cnt+=1
A+=[cnt,cnt]

ans=0
dp=2*K+1
if First=="0":
    p=0
else:
    p=1
while p+dp<len(A):
   if A[p+dp]-A[p]>ans:ans=A[p+dp]-A[p]
   p+=2
print(ans)

N,K=map(int,input().split())
S=input()
First=S[0]
Last=S[N-1]

Now=First
cnt=0
A=[0,0]
for s in S:
    if Now=='1' and s=='0':
        A+=[cnt]
        Now='0'
    elif Now=='0' and s=='1':
        A+=[cnt]
        Now='1'
    cnt+=1
A+=[cnt,cnt]

ans=0
dp=2*K+1
if First=="0":
    p=0
else:
    p=1
while p+dp<len(A):
   if A[p+dp]-A[p]>ans:ans=A[p+dp]-A[p]
   p+=2
print(ans)

A,B=list(map(int,input().split()))
if A==B:
  print(2*A)
else:
  print(2*max(A,B)-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):

but=map(int,input())
but = sorted(but)
res = but[-1]
but = sorted(but)
res = but[-1]
print(res)



but=list(map(int,input()))
but = sorted(but)
res = but[-1]
but = sorted(but)
res += but[-1]
print(res)



but=list(map(int,input().split()))
but = sorted(but)
res = but[-1]
but[-1] -= 1
but = sorted(but)
res += but[-1]
print(res)


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

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

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



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

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

print(a+b)



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

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



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

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



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

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


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())
print(max(2*a-1,a*b,2*b-1))

a,b=map(int,input().split())
print(max(2*a-1,a+b,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):
def main():
    A, B = map(int, input())
    if A == B:
        M = A + B
    elif A > B:
        M = A + (A - 1)
    else:
        M = B + (B - 1)
    print(M)

if __name__ == "__main__":
    main()


NUM_PUSH = 2


def main():
    A, B = map(int, input().split())
    sum = 0
    for i in range(NUM_PUSH):
        if A >= B:
            push = A
            A -= 1
        else:
            push = B
            B -= 1
        sum += push
    print(sum)


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):
A, B = list(map(int, input().split()))
if A == B :
    print(2*A)
else :
    print(2*max(a, b)-1)

A, B = list(map(int, input().split()))
if A == B :
    print(2*A)
else :
    print(2*max(A, 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=input()
coin=0
for i in range(0,2):
    pre=max(A,B)
    coin+=pre
    if(pre==A):
        A-=1
    else:
        B-=1

A,B=(int(x) for x in input().split())
coin=0
for i in range(0,2):
    pre=max(A,B)
    coin+=pre
    if(pre==A):
        A-=1
    else:
        B-=1

A,B=input()
coin=0
for i in range(0,2):
    pre=max(A,B)
    coin+=pre
    if(pre==A):
        A-=1
    else:
        b-=1

A,B=(int(x) for x in input().split())
coin=0
for i in range(0,2):
    pre=max(A,B)
    coin+=pre
    if(pre==A):
        A-=1
    else:
        B-=1
print(coin)

Verdicts: Runtime Error

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

if A == B:
    print(A+B)
else:
    print(max(A, B)- 1)

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):
a,b = map(int,input().split())
if a<b:
  print(2*b-1)
elif a=b:
  print(2*a)
else:
  print(2*a-1)

a,b = map(int,input().split())
if a<b:
  print(2*b-1)
elif a==b:
  print(2*a)
else:
  print(2*a-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):
S=input()
N=len(S)
list1=list(map(int,S))
ans1=0
for i in range(len(list1)):
    if i%2==0:
        if list1[i]==1:
            ans1+=1
    elif i%2==1:
        if list1[i]==0:
            ans1+=1
ans2=min(ans1,(N-ans1))
print(ans2)
        

N=int(input())
H=list(map(int,input().split()))
ans=0
for i in range(len(H)):
    if i==0:
        ans+=1
    elif max(H[0:i])<=H[i]:
        ans+=1
print(ans)

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

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,a,b,=map(int,input().split())
if a*n>b:
    print(b)
if a*n<b:
    print(a*n)
if a*n==b:
    print(a*n)

n,a,b,=map(int,input().split())
if a*n>b:
    print(b)
if a*n<b:
    print(a*n)
if a*n==b:
    print(a*n)

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

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

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

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

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


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

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




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):
def recur(ba,bb):
    print("Call: =(")
    if(ba <= 0 and bb <= 0):
        return 0
    if(ba <= 0):
        #only b twice
        return (bb*2)-1
    elif(bb<=0):
        return (ba*2)-1
    else:
        tb = max(bb+bb-1,recur(ba,bb-2))
        ta = max(ba+ba-1,recur(ba-2,bb))
        bt = max(ba+bb,recur(ba-1,bb-2))
        return max(max(tb,ta),bt)

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

print(recur(a,b))


def recur(ba,bb):
    tb = (2*bb)-1
    ta = (2*ba)-1
    bt = ba+bb
    return max(max(tb,ta),bt)

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

print(recur(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 = map(int,input().split())
ans = 0
for i in range(N):
  if a>=b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)

a,b = map(int,input().split())
ans = 0
for i in range(2):
  if a>=b:
    ans += a
    a -= 1
  else:
    ans += 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, B = list(map(int,input()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A == B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])
 
A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)
 
print(result_1 + result_2)

A, B = list(map(int,input()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A = B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])

A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)

print(result_1 + result_2)

A, B = list(map(int,input().split()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A == B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])
 
A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)
 
print(result_1 + result_2)

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()
M=max(a,b)
m=min(a,b)

n=0
n+=M
M-=1

n+=max(M,m)

print(n)

a,b=map(int,input().split())
M=max(a,b)
m=min(a,b)

n=0
n+=M
M-=1

n+=max(M,m)

print(n)

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(a + b)
else:
  print(max(a, b) * 2 - 1)

a, b = map(int, input().split())
if a == b:
  print(a + b)
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,b)*2)

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

if a == b:
  print(a+b)
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):
if a>=b:
    k=a
    a=a-1
else:
    k=b
    b=b-1

if a>=b:
    k=k+a
else:
    k=k+b

print(k)

a, b= (int(i) for i in input().split())  
a=3
b=5

if a>=b:
    k=a
else:
    k=b

if a>=b:
    k=k+a
else:
    k=k+b

print(k)

a, b= (int(i) for i in input().split())  

if a>=b:
    k=a
    a=a-1
else:
    k=b
    b=b-1

if a>=b:
    k=k+a
else:
    k=k+b

print(k)

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

ans = 0
for i in range(len(H)):
  chkflg = True
  if i >= 1:
    for j in range(i): 
      if H[j] > H[i]:
        chkflg = False
        break

  if chkflg: ans += 1

print(ans)   



A, B = map(int, input().split())
ans = 0
for i in range(2):

  if A > 3 and A >= B:
    ans += A
    A -= 1
    continue

  if B > 3 and B > A:
    ans += B
    B -= 1
    continue
  
  if A == 3 and B == 3:
    ans += A

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,b=map(int,input().split())
print(max(max(a,b)-1,min(a,b))+e)

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


a, b = map(int, input().split())
coin = 0
for i in range(2):
    if a > b:
        coin += a
        a -= 1
    else:
        coin += b
        b -= 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):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    if V[i] - C[i] > 0:
        ans += V[i] - C[i]

print(ans)

A,B = map(int, input().split())
ans = 0
for i in range(2):
    if A > B:
        ans += A
        A = A - 1
    else:
        ans += 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 2*a-1 > 2*b-1:
    if (2*a-1) > a+b:
        print(2*a-1)
    else:
        print(a+b)
else:
    if 2*b-1 > a+b:
        print(2*b-1)
    else:
        print(a+b)


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

s = 0
for i in range(2):
    if A > B:
        s += A
        A -= 1
    elif B > A:
        s += B
        B -= 1
    elif A == B:
        s += A
        A -= 1
print(s)

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

if(abs(A-B) >= 2):
    res = max(A,B)+(max(A,B)-1)
else:
    res = A+B
print(res)





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

def main():
	A,B = map(int,input().split())
	res = A if A >= B else B
	if res == A :
		A -= 1
	else :
		B -= 1
	res += A-1 if A-1>=B else B
	print(res)

if __name__ == "__main__" :
	main()


def main():
	A,B = map(int,input().split())
	res = A if A >= B else B
	res = A-1 if A-1>=B else B
	print(res)

if __name__ == "__main__" :
	main()


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

if __name__ == "__main__" :
	main()


def main():
	A,B = map(int,input().split())
	res = A if A >= B else B
	if res == A :
		A -= 1
	else :
		B -= 1
	res += A if A>=B else B
	print(res)

if __name__ == "__main__" :
	main()
 

Verdicts: Wrong Answer

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):
# -*- coding: utf-8 -*-
import numpy as np

def main():
    a=int(input())
    b=int(input())
    c=max(a,b)
    print(c+(c-1))

if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-
import numpy as np

def main():
    i=list(map(int, input().split()))
    coin=0
    if (i[0]<i[1]):
        coin =coin+i[1]
        i[1] =i[1]-1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    if (i[0] < i[1]):
        coin = coin + i[1]
        i[1] = i[1] - 1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    print(coin)

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):
a, b = map(int, input().split())

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

print(res)


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

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

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):
print(sum([max([int(n) for n in input().strip().split()])-a for a in [0,1]]))

nm = [int(n) for n in input().split()];nm.extend([n-1 for n in nm]);nm.sort();nm.reverse();print(sum(nm[:2]));


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 >= 2:
  print(2a-1)
elif b-a >= 2:
  print(2b-1)
else:
  print(a+b)

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

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)*2
print(ans if a!=b else ans-1)

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

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 = list(map(int,input().split()))
print(max(A[0]*2-1,A[1]*2-1,A[0]*A[1]))

A = list(map(int,input().split()))
print(max(A[0]*2-1,A[1]*2-1,A[0]+A[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=int(input())
B=int(input())

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


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

l=[0]
curr='1'

for c in S:
    if c !=curr:
        l.append(1)
        curr=c
    else:
        l[-1]+=1
if curr=='0':
    l.append(0)

n_group=len(1)
sum_=0
k =min(k,n_group)

for i in range(k):
    sum_+=l[2*i]+l[2*i+1]
sum_ +=l[2*k]
max_=sum_

for i in range(k,n_group):
    sum_ -=l[2*i-2*k]+l[2*i+1-2*k]
    sum_ +=l[2*i+1]+l[2*i+2]
    max_ =max(max_,sum_)

print(max_)   


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


Verdicts: Runtime Error

Runtime Error

Accepted