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 = int(input())
B = int(input())

OnlyA = A+(A-1)
 
OnlyB = B+(B-1)
 
AaddB = A + B
 
print(max([OnlyA,OnlyB,AaddB]))

A,B= [int(input()) for i in range(2)]  
OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))


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

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max[OnlyA,OnlyB,AaddB])

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

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))

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


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

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

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

Verdicts: Wrong Answer

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):
# -*- coding: utf-8 -*-
# Input
list = [int(a) for a in input().split()]


list.sort()
num = 0
if list[0] > list[1] + 1:
    num = list[0] * 2 - 1
else:
    mum = sum(list)

print(sum(list))


# -*- coding: utf-8 -*-
# Input
list = [int(a) for a in input().split()]


list.sort()
print

if list[0] > list[1] + 1:
    num = list[0] * 2 - 1
else:
    mum = sum(list)

print(num)


# -*- coding: utf-8 -*-
# Input
list = [int(a) for a in input().split()]


list.sort()

num = 0
if list[1] > list[0] + 1:
    num = list[1] * 2 - 1
else:
    num = sum(list)

print(num)


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())
ans = 0;
for i in range(2):
  if A > B:
    ans += A
    A -= 1
  else:
    ans += B:
    B -= 1
else:
  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
else:
  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):
N,K = (int(i) for i in input().split())
K += 2 
S = input()
S = [s for s in S]
cnt = []
last = S[0]
c = 0

for s in S:
    if s == last:
        c += 1
    else:
        cnt.append(c)
        c = 1
        last = s

cnt.append(c)
cnt.extend([0,0,0])
hold = sum([cnt[n] for n in range(K+1)])
ans = [hold]
for i in range(1,len(cnt)-K):
    #right => cnt[i-1]
    #left => cnt[i+K]
    ans.append(hold-cnt[i-1]+cnt[i+K])
    hold = sum([cnt[n+i] for n in range(K+1)])
print(max(ans))


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

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

if a > b:
  print(h+a)
else:
  print(h+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())
res = 0
if A >= B:
    res += A
    A-= 1
    if A >= B:
        res += A 
    else:
      res += B
      print(res)
else:
    res += B
    B-= 1
    if A >= B:
        res += A
    else:
      res += B
      print(res)

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


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

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

Verdicts: Wrong Answer

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 = list(input())
n_size = len(n)
count = 0
#print(n_size)  
new_list = []
new_list.append(int(n[0]))
for i in range(n_size-1):
  if new_list[i] == 0:
    new_list.append(1)
  else:
    new_list.append(0)

#print(new_list)
    
for i in range(n_size):
  if (int(n[i]) != int(new_list[i])):
    count+=1

#print(new_list)    
if n_size == 1:
  print(0)
else:
#  ans = n_size-count    
  print(count)    
    


n = input().split()
count = 0
if int(n[0]) > int(n[1]):
  count +=int(n[0])
  if int(n[0])-1 > int(n[1]):
    count +=int(n[0])-1
  else:
    count +=int(n[1])
else:
  count +=int(n[1])
  if int(n[1])-1 > int(n[0]):
	  count +=int(n[1])-1
  else:
	  count +=int(n[0])

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

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


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

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

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

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 sub():
    N, K = [int(e) for e in input().split(" ")]
    ss = [int(e) for e in input()]
    # if len(set(ss)) == 1:
    #     print(len(ss))
    #     return

    dd = [ss[i+1] - ss[i] for i in range(N-1)]
    idd = [0] + [i+1 for i, d in enumerate(dd) if d != 0]
    # print(idd)
    maxScore = 0
    for i in range(len(idd)):
        if ss[i] == 0:
            ni = i + 2*K
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        else:
            ni = i + 2*K + 1
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        
    print(maxScore)

sub()


def sub():
    A, B = [int(e) for e in input().split(" ")]
    N = 0
    for _ in range(2):
        if A > B:
            N = N + A
            A = A -1
        else:
            N = N + B
            B = B - 1
    print("{}".format(N))

sub()


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

num_ryokan = 0
max_height = 0

for i in range(N):
  if max_height <= H[i]:
    num_ryokan +=1
    max_height = H[i]

print(num_ryokan)

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

def button(a,b):
    if a>b:
        return 2*int(a)-1
    if a<b:
        return 2*int(b)-1
    if a==b:
        return int(a)+int(b)
a = input()
b = input()
button(a,b)

def button(a,b):
    if a==b:
        return int(a)+int(b)
    else:
        return 2*int(max(a,b))-1
a = int(input())
b = int(input())
button(a,b)

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

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):
A,B=map(int,input().split())
print(min(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):
a,b=map(int,input().split())
ans=0
if max(a,b)==a:
  ans=ans+a
  a=a-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1
  elif max(a,b)==b:
    ans=ans+b
    b=b-1
elif max(a,b)==b:
    ans=ans+b
    b=b-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1    
  elif max(a,b)==b:
    ans=ans+b
    b=b-1      
print(ans)   
    

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

A = input()
B = input()
x = 0

for num in range(1)
	if A < B;
		x = x + A
		A = A - 1
    else
    	x = x + B
      	B = B - 1
print(x)


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

min(S[::2].count("0")+S[1::2].count("1"), S[::2].count("1")+S[1::2].count("0"))

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

larger = max(A, B)
lesser = min(A, B)

s = 0
if(larger<=lesser):
    s = 2*larger
else:
    s = 2*larger-1

print(s)

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())
N=len(S)
A=[]
B=[]
for i in range(N):
    A.append(str(i%2))
    B.append(str((i+1)%2))
countA=0
countB=0
for x in range(N):
    if A[x]!=S[x]:
        countA+=1
    else:
        countB+=1
print(min(countA,countB))

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: 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(A+B)

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


print(X)

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

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(input().split())
b=int(a[0])
c=int(a[1])
if b>c:
  print(b+(b-1))
elif c>b:
  print(c+(c-1))
elif b=c:
  print(2*b)

a=list(input().split())
b=int(a[0])
c=int(a[1])
if b>c:
  print(b+(b-1))
elif c>b:
  print(c+(c-1))
elif b==c:
  print(2*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 = int(input().split())

count = 0

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

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

count = 0

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

if a > b :
  count += a
  a -= 1
else:
  count += b
  b -= 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):
def init(a):
    cf=a[0]
    cc=0
    z=[]
    for it in a:
        if(it==cf):
            cc+=1
        else:
            if(cf=='0'):
                z.append(-cc)
            else:
                z.append(cc)
            cf=it
            cc=1
    z.append(cc)
    return z

p=[]
def solve(a,K):

    if(K==0):
        p.append(max(a))
        return
    N=len(a)
    if(K%2==0):
        if(a[0]>0):
            b=[]
            b.append(a[1]-a[0])
            for j in range(2,N):
                b.append(a[j])
            solve(b,K-1)
        if(a[N-1]>0):
            b=[]
            for j in range(2,N):
                b.append(a[j])
            b.append(a[N-2]-a[N-1]) 
            solve(b,K-1)            
        for i in range(1,N-1):
            if(a[i]>0):
                b=[]
                for j in range(0,i-1):
                    b.append(a[j])
                b.append(a[i-1]-a[i]+a[i+1])
                for j in range(i+2,N):
                    b.append(a[j])
                solve(b,K-1)
    else:
        if(a[0]<0):
            b=[]
            b.append(a[1]-a[0])
            for j in range(2,N):
                b.append(a[j])
            solve(b,K-1)
        if(a[N-1]<0):
            b=[]
            for j in range(2,N):
                b.append(a[j])
            b.append(a[N-2]-a[N-1]) 
            solve(b,K-1)            
        for i in range(1,N-1):
            if(a[i]<0):
                b=[]
                for j in range(0,i-1):
                    b.append(a[j])
                b.append(a[i-1]-a[i]+a[i+1])
                for j in range(i+2,N):
                    b.append(a[j])
                solve(b,K-1)

N,K=list(map(int,input().split(" ")))
a=str(input())
z=init(a)
L=len(a)
Q=0
if(z[0]<0):
    Q=N//2+1
else:
    Q=N//2
if(K>=Q):
    print(N)
else:

    solve(z,K)
    print(max(p))


a=list(map(int,input().split(" ")))
x,y=sorted(a)
print(x,y)
if(y-1>x):
    print(y+y-1)
else:
    print(y+x)



a=list(map(int,input().split(" ")))
x,y=sorted(a)
if(y-1>x):
    print(y+y-1)
else:
    print(y+x)



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


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

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

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

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

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

a = int(input())
b = int(input())

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

A, B = list(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: 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)*2)

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

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

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

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

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

a=x+x+1
b=x+y
c=y+y+1

if a>b:
  if a>c:
    ans=a
else:
  if b>c:
    ans=b
  else:
    ans=c
    
print(ans)

coin = list(map(int, input().split()))
a=coin[0]
b=coin[1]

sum1=a+a-1
sum2=a+b
sum3=b+b-1

if sum1<sum2:
    if sum3<sum2:
        ans=sum2
    else:
        ans=sum3
else:
    if sum1>=sum3:
        ans=sum1

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


a=int(input())
b=int(input())
sum=0
if a >= b:
    sum += a
    a -= 1
    if a >= b:
        sum += a
    else:
        sum += b
else:
    sum += b
    if a < b:
        sum += b
    else:
        sum +=a
print(sum)

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

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

AB = input().split()
A,B=int(AB[0]), int(AB[1])
if max(A,B)-min(A,B) >= 1:
  print(2*max(A,B)-1)
else:
  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())
ans = 0

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


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

print(max(A, B) * 2 - (1 if A != B else 0))


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())
ans = 0

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    ans = B + (B - 1)

print(ans)

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

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    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()) 
sum = 0

print(A)
print(B)

if A > B:
    sum = A + (A - 1)
if B > A:
    sum = B + (B - 1)
else:
    sum = A + B

print(sum)

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

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

print(sum)

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

print(A)
print(B)

if A > B:
    sum = A + (A - 1)
elif B > A:
    sum = B + (B - 1)
else:  
    sum = A + B

print(sum)

A = input('A = ')
A = int(A)
B = input('B = ')
B = int(B)
sum = 0

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

print(sum)

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

if A > B:
    sum = A + (A - 1)
elif B > A:
    sum = B + (B - 1)
else:  
    sum = A + B

print(sum)

Verdicts: Wrong Answer

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):
import sys
N, K = map(int, input().split())
s = input()
  
group = []
sign = s[0]
curr = 0
for i in range(N):
  curr += 1
  if s[i] != sign: 
    group += [curr-1]
    curr = 1
    sign = s[i]
else:group += [curr]

if s[0] == '0' :
  if s[N-1] == '0':
    m = (len(group)+1)//2
    if K >= m:
      print(N)
      sys.exit()
    score = [sum(group[:2*K])]
    for i in range(m-K):
      score += [score[-1] - group[2*i] + group[2*i+2*K]]
  else :
    m = (len(group)+1)//2
    if K >= m:
      print(N)
      sys.exit()
    score = [sum(group[:2*K])]
    for i in range(m-K):
      score += [score[-1] - group[2*i] + group[2*i+2*K]]
    score[-1] += group[-1]
else:
  0/0
  m = len(group)//2
  group += [0]
  if K >= m:
    print(N)
    sys.exit()
  score = [sum(group[:2*K+1])]
  for i in range(m-K):
    score += [score[-1] - group[2*i] - group[2*i+1] + group[2*i+2*K+1]+group[2*i+2*K +2]]

print(max(score))

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


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

a,b = map(int,input().split())
if a== b:print(a+b)
else:print(2*(a+b -min(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):
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [a, b] = string_to_int(inputs[0])

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

    return ret


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)


import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [a, b] = string_to_int(inputs[0])

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

    return ret


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)


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,max(A+B,B+B)))

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

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

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B


MaxCoinCount(a, b)

def MaxCoinCount(A,B):
  max = 0
  for i in range(2):
    if A >= B:
      max = max + A
      A = A - 1
    else:
      max = max + B
      B = B - 1
  return max



a = input()
b = input()

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B


MaxCoinCount(a, b)

def MaxCoinCount(A,B):
  max = 0
  for i in range(2):
    if A >= B:
      max = max + A
      A = A - 1
    else:
      max = max + B
      B = B - 1
  return max

print(MaxCoinCount(5, 6))

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
    A = A - 1
  else if A < B:
    ans = B + (B + 1)
  else:
    ans = A + B

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B



def MaxCoinCount(A,B):
  for i in range(2):
    if A >= B:
      max = A
      A = A - 1
    else:
      max = B
      B = B - 1
  return max

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B



def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B

MaxCoinCount(A, B)

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

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B - 1)
  else:
    ans = A + B
  return ans


print(MaxCoinCount(A,B))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

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

print(n)

A,B = map(int,input().split())
if B < A:
    n = A
    A -= 1
else:
    n = B
    B -= 1
if B < A:
    n += A
else:
    n += 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):
# -*- coding: utf-8 -*-
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


# -*- coding: utf-8 -*-
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: 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())

ans = 0
a = max(a,b)
b = min(a,b)
ans += a
a -= 1
a = max(a,b)
b = min(a,b)
ans += a

print(ans)

a,b = map(int,input().split())
 
ans = 0
c = max(a,b)
d = min(a,b)
ans += c
c -= 1
e = max(c,d)
f = min(a,b)
ans += e
 
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):
n = int(input())
height = list(map(int,input().split()))

no_ocean = 0

for i in range(1,n):
  for k in range(i):
    if height[k] > height[i]:
      	no_ocean += 1
      	break
    else:
        continue
        
print(n - no_ocean)
    

a,b = input().split()

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

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

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

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 = [int(i) for i in input().split("")]
if a[0] == a[1]:
    print(2 * a[0])
else:
    print(2 * max(a) - 1)

a = [int(i) for i in input().split(" ")]
if a[0] == a[1]:
    print(2 * a[0])
else:
    print(2 * max(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):
import sys
stdin = sys.stdin 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
N,K=na();S=ns()
l=[]
N=len(S)
if(S[0]=="0"):
    l.append(0)
b=S[0]
ct=1
for i in S[1:]:
    if(b!=i):
        l.append(ct)
        ct=1
        b=i
    else:
        ct+=1
l.append(ct)

len_l=len(l)
if(len_l//2 <= K):
    print(sum(l))
    exit()
res = sum(l[:2*K+1])
ans=res
if(len_l%2==0):
    l.append(0)
    len_l+=1
g = K * 2 + 1
for i in range(K*2+1,len_l-1,2):
    ans -= l[i-g] + l[i+1-g]
    ans += l[i] + l[1+i]
    res = max(ans,res)
#print(l)
print(res)

import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

A,B=na()
if(A==B):
    print(A+B)
elif(A>B):
    if(A-1>B):
        print(A+A-1)
    else:
        print(A+B)
elif(B>A):
    if(B-1>A):
        print(B+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=int(input())
b=int(input())
c=max(a,b)
d=min(a,b)
e=max(c-1,d)
print(c+e)

a=int(input())
b=int(input())
c=max(a,b)
d=min(a,b)
e=max(c-1,d)
print(c+e)

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

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):
s = input()
c = 0

for x in range(len(s)):
    c += 1 if s[x] != str(x%2) else 0

print(c if c < x+1-c else x+1-c)

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


a = input()
b = input()
if a < b:
  swap(a,b)
if a == b:
  print(a*2)
else:
  print(a*2-1)

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

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

ans = data[2]-(data[0]-data[1])

if ans > 0:
     print(ans)
else:
    print("0")


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

# AA AB BB
max = max(data[0]+data[0]-1, data[0]+data[1], data[1]+data[1]-1)

print(max)


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):
inputs = [int(input()) for i in range(2)]

print(max([sum(inputs), inputs[0]*2-1, inputs[1]*2-1]))

inputs = list(map(int, input().split(" ")))
print(max([sum(inputs), inputs[0]*2-1, inputs[1]*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, raw_input().split)
ans = 0
for i in range(2):
  if a >= b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)

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

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

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

n = input()
c1=c2=0
l = len(n)
c1 = n - (len([for i in l[0::2] if n == "0"])) - (len([for i in l[1::2] if n == "1"]))
c2 = n - (len([for i in l[0::2] if n == "1"])) - (len([for i in l[1::2] if n == "0"]))

print(min(c1,c2))

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

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

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

A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
elif A==B:
  print(A+B)
else:
  print(2*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):
N=int(input())
H=list(map(int,input().split()))
if N==1:
    print(1)
else:
    maxh=H[0]
    c=1
    for i in range(1,N):
        if maxh<=H[i]:
            c+=1
            maxh=H[i]
    print(c)

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

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

print(a + b + 1)


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

x1 = max(a, b)

if x1 == a:
  a = a-1
  x2 = max(a, b)
  print(x1+x2)
elif x1 == b:
  b = b-1
  x2 = max(a, b)
  print(x1+x2)

Verdicts: Wrong Answer

Accepted