Problem:


Score : 100 points

Problem Statement

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?

Constraints

All values in input are integers.

3 \leq A, B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the maximum number of coins you can get.

Sample Input 1

5 3

Sample Output 1

9

You can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.

Sample Input 2

3 4

Sample Output 2

7

Sample Input 3

6 6

Sample Output 3

12



Sample input:
5 3


Sample output:
9

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a = list(map(int, input().split()))
    a.sort()
    if a[0] == a[1]:
        print(a[0] + a[1])
    else:
        print(a[1] + a[1] - 1)

main()

Submission status: Accepted

Solution code:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

a,b=mi()
ans=max(a+a-1,a+b)
ansans=max(ans,b+b-1)
print(ansans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int, input().split())

if a==b:
    print(a*2)

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

Submission status: Accepted

Solution code:
A,B = sorted(map(int,input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())

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

Submission status: Accepted

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

if A == B:
    print(A*2)
elif (A == B + 1) or (A + 1 == B):
    print(A+B)
else:
    print(max(A+(A-1), B+(B-1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
print(max(2*A-1,2*B-1,A+B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().strip()

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

main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
num = 0

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, raw_input().split(' '))
print max((a<<1) - 1, (b<<1)-1, a + b)

Submission status: Accepted

Solution code:
def solve():
    a, b = map(int, input().split())
    ans = 0
    for _ in range(2):
        if a >= b:
            ans += a
            a -= 1
        else:
            ans += b
            b -= 1

    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

x = 0

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

print(x)

Submission status: Accepted

Solution code:
def main():
    a,b=map(int,input().split())
    if a == b:
        print(a+b)
    else:
        m = max(a,b)
        print(m*2-1)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(2):
    ans+=max(a,b)
    if a>=b:
        a-=1
    else:
        b-=1
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
x = 0
for i in range(2):
  if a >= b:
    x += a
    a -= 1
  else:
    x += b
    b -= 1
print(x)

Submission status: Accepted

Solution code:
q = list(map(int, input().split()))
print(max(q) * 2 - (q[1] != q[0]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for _ in range(2):
    if a >= b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(sum(sorted([a, b, a-1, b-1])[2:]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
A,B=map(int, input().split())
ans=[]
if A>B:
    ans.append(A)
    A-=1
else:
    ans.append(B)
    B-=1

if A>B:
    ans.append(A)
else:
    ans.append(B)
    
print(sum(ans))

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b = map(int, input().split())
    ans = 0
    for _ in range(2):
        if a > b:
            ans += a
            a -= 1
        else:
            ans += b
            b -= 1

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b = map(int, input().split())
    arr = [a, b, a - 1, b - 1]
    arr.sort()
    print(arr[2] + arr[3])


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())
print(max(a+b, a*2-1, b*2-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    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)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
#A
a,b = map(int,input().split())
cnt = 0
if a > b:
    cnt += a
    a -= 1
else:
    cnt += b
    b -= 1
   
if a > b:
    cnt += a
    a -= 1
else:
    cnt += b
    b -= 1
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

#A,Bに対し、得られるコインの枚数はCOIN１、COIN2、COIN３の３パターンあり、その中で最大値を表示したい

COIN1= A+B
COIN2=A + A-1
COIN3=B + B-1
#print(COIN1) 
#print(COIN2)
#print(COIN3)

if COIN1>= COIN2 and COIN1 >= COIN3:
        print(COIN1)
elif COIN2 >=COIN1 and COIN2 >= COIN3:
    print(COIN2)
elif COIN3 >= COIN1 and COIN3 >=COIN2:
    print(COIN3)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

x = a + (a - 1)
y = a + b
z = b + (b - 1)

w = max(x, y, z)

print(w)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=max(a+b,2*a-1,2*b-1)

print(ans)

Submission status: Accepted

Solution code:
N=list(map(int,input().split()))
N.append(N[0]-1)
N.append(N[1]-1)
N.sort(reverse=True)

print(sum(N[0:2]))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
l=[a,b]
l.sort()
ans=l[1]
l[1]=l[1]-1
l.sort()
ans+=l[1]
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

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

Submission status: Accepted

Solution code:
import math
def ip():return int(input())
def inp():return map(int,input().split())
def inpstr():return map(str,input().split())
def linp():return list(map(int,input().split()))
def linpstr():return list(map(str,input().split()))

a,b=inp()
ans=0
if a<b:a,b=b,a
ans+=a
a=a-1
if a<b:a,b=b,a
ans+=a
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
c = max(a,b)

print(max((a+b), (2*c-1)))

Submission status: Accepted

Solution code:
m,n = map(int,input().split())
if m == n:print(m+n)
else:print(max(m,n)*2-1)

Submission status: Accepted

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

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m,n = map(int,input().split())
if m == n:
    print(m+n)
else:
    print(max(m,n)*2-1)

Submission status: Accepted

Solution code:
button=list(map(int,input().split()))
button.sort()
sco = 0
sco += button[1]
button[1] -= 1
button.sort()
sco += button[1]
print(sco)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=max(a,b)
y=min(a,b)

z=max(x-1,y)
print(x+z)

Submission status: Accepted

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

C=[A+(A-1),A+B,B+(B-1)]

print(max(C))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

x = sorted([a, b, a - 1, b - 1], reverse=True)

print(x[0] + x[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding = SJIS
a, b = map(int, input().split())
ans = 0
if a <= b:
    ans += b
    b -= 1
    ans += max(a, b)
else:
    ans += a
    a -= 1
    ans += max(a, b)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
k = 0
for i in range(2):
  if a >= b:
    k += a
    a -= 1
  else:
    k += b
    b -= 1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print(max(A*2-1,B*2-1,A+B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    A, B = map(int, input().split())

    ans = 0
    for _ in [1, 2]:
        if (A <= B):
            ans += B
            B -= 1
        elif (A > B):
            ans += A
            A -= 1

    print(ans)


resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

m=max(a,b)

if a==b:print(a+b)

else:print(2*m-1)

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

c = 0

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

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

Submission status: Accepted

Solution code:
def main():
  num = list(map(int,input().split()))
  flg=0
  if num[0]>num[1]:
    print(num[0]*2-1)
  elif num[1]>num[0]:
    print(num[1]*2-1)
  else:
    print(num[0]*2)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    A, B = map(int, input().split())
    ans = 0
    for i in range(2):
        ans += max(A,B)
        B = min(A,B)
        A = ans - 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
cnt = 0
for _ in range(2):
    if a >= b:
        cnt += a
        a -= 1
    else:
        cnt += b
        b -= 1
print(cnt)

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/A_problems/124.py
#
a, b = map(int, input().split())
if a == b:
    print(2*a)
else:
    print(2*max(a, b)-1)

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
A = list(map(int, input().split()))

a =max(A)
coin =a
a -=1
A.append(a)

A.sort()
a_2 =A[1]
coin +=a_2

print(coin)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if max(x, y) - 2 >= min(x, y):
    print(max(x,y)*2-1)
else:
    print(max(x, y) + min(x, y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
tmp = 0

if B < A:
  tmp = B
  B = A
  A = tmp

cnt = B
B = B-1

if B < A:
  tmp = B
  B = A
  A = tmp

print(cnt+B)

Submission status: Accepted

Solution code:
import re
n = input()
m = re.search('(\d+)\s(\d+)', n)
a = int(m.group(1))
b = int(m.group(2))
i = 0
if a < b:
    i += b
    b -= 1
    if a < b:
        i += b
        print(i)
    else:
        i += a
        print(i)
else:
    i += a
    a -= 1
    if a < b:
        i += b
        print(i)
    else:
        i += a
        print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
score=0
n=0
while n<2:
    if a>b:
        score+=a
        a-=1
    else:
        score+=b
        b-=1
    n+=1
print(score)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=0
for i in range(2):
    if a>=b:
        c+=a
        a-=1
    else: 
        c+=b
        b-=1
print(c)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

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

print(ans)

Submission status: Accepted

Solution code:
l=list(map(int,input().split()))
print(max(l)+max(max(l)-1,min(l)))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for _ in range(2):
  if a > b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
print(max(A, B) * 2 - (A != B))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print(sum(sorted([A,B,A-1,B-1])[-2:]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
l = [a+a-1, a+b, b+b-1]
print(max(l))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if a == b:
    ans = a + b
else:
    m = max(a, b)
    ans = m + m - 1

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())


if abs(a - b) > 0:
    m = max(a, b)
    ans = m + m - 1
else:
    ans = a + b

print(ans)

Submission status: Accepted

Solution code:
# input
A, B = map(int, input().split())

# check
coins = 0
for n in range(2):
    if A > B:
        coins += A
        A -= 1
    else:
        coins += B
        B -= 1
        
print(coins)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split());c=[a,b,a-1,b-1];c.sort();print(sum(c[-2:]))

Submission status: Accepted

Solution code:
data = list(map(int, input().split()))

ans = 0
for _ in range(2):
  p = data.index( max(data) )
  ans += data[p]
  data[p] -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    A, B = max(A, B), min(A, B)
    return A + max(A-1, B)
print(main())

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print(max(2*A-1, A+B, 2*B-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    

    
    a, b = mi()
    ans = 0

    def push():
        nonlocal a, b, ans
        if a > b:
            ans += a
            a -= 1
        else:
            ans += b
            b -= 1
    push()
    push()

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    if A == B:
        ans = A + B
    else:
        ans = max(A, B)
        ans = ans + (ans - 1)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
r1=max(a,b)
m=min(a,b)
r2=max(r1-1,m)
print(r1+r2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
import  numpy as np

point = 0

button =np.array([a,b])

point += np.max(button)
index = np.argmax(button)

button[index]-=1

point += np.max(button)

print(point)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L=lambda:list(map(int,input().split()))
def main():
    a,b=L()
    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)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B = inputIL()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    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)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a <= b:
  ans = b
  b -= 1
else:
  ans = a
  a -= 1
  
ans += max(a, b)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split(' '))

large = max(A, B)
small = min(A, B)

total = large
large -= 1
total += max(large, small)

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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