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: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
sum = 0
A, B  = input().split(" ")
if A != int() and B != int():
    A = int(A)
    B = int(B)
    for i in range(2):
        if A > B:
            sum += A
            A -= 1
            print(sum)
        elif B > A:
            sum += B
            B -= 1
            print(sum)
        elif A==B:
            sum += A
            A -= 1
            print(sum)

Submission status: Wrong Answer

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

print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, raw_input().split()) 
x = a                                
m = b             
if x < b:                            
    x = b                            
r = x * 2                            
x = r - 1                            
print x

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())

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

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

    prev = s[i]

print(count)

Submission status: Wrong Answer

Solution code:
#2 個のボタンがあり、大きさはそれぞれ A,B です。大きさ X のボタンを押すと、X 枚のコインを獲得し、そのボタンの大きさが 1 小さくなります。
#あなたは、いずれかのボタンを押すことを 2 回行います。 同じボタンを 2 回押しても構いません。
#最大で何枚のコインを獲得できるでしょうか。

#解説
#大きい方のボタンを選んで押すことを 2 回繰り返すのが最適です。基本的には同じボタンを押しますが、 
#A = B のときは両方のボタンを 1 回ずつ押すのが最適なので、注意する必要があります。
#実装では、以下の 3 つのパターンについて場合分けすると比較的簡単に書くことができます。
#• A > B の場合: A+(A−1) が答えになります。 • A < B の場合: B + (B − 1) が答えになります。 • A = B の場合: A+B が答えになります。

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

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

Submission status: Wrong Answer

Solution code:
#2 個のボタンがあり、大きさはそれぞれ A,B です。大きさ X のボタンを押すと、X 枚のコインを獲得し、そのボタンの大きさが 1 小さくなります。
#あなたは、いずれかのボタンを押すことを 2 回行います。 同じボタンを 2 回押しても構いません。
#最大で何枚のコインを獲得できるでしょうか。

A, B = map(int, input().split())
a = A*(A+1)/2
b = B*(B+1)/2
print(int(a+b))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=0

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("提出テスト")

Submission status: Wrong Answer

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

max  = a + a-1
if max < a + b:
    max = a + b
elif max < b + b-1:
    max = b + b-1
print(max)

Submission status: Wrong Answer

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

A = sorted(A)
ans = 0
ans += A[0]
A[0] -= 1
A = sorted(A)
ans += A[0]
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
count = 0
n = len(s)
if n % 2 == 0:
    for i in range(0,int(n/2)):
        if s[(2*i)+1] == "0":
            count = count + 1
            print(i)
    for j in range(0,int(n/2)):
        if s[2*j] == "1":
            count = count + 1
            print(j)
else:
    for i in range(0,int((n-1)/2)+1):
        if s[2*i] == "0":
            count = count + 1
    for j in range(0,int(((n-1)/2))):
        if s[2*j + 1] == "1":
            count = count + 1
count2 = n - count
print(min(count,count2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- 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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
x = max(X,Y)
y = min(X, Y)
S = x + max(X-1, Y)
print(S)

Submission status: Wrong Answer

Solution code:
def money(A, B):
    if A<B:
        return 2*B-1
    elif A>B:
        return 2*A-1
    else:
        return A+B

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(max(C)+max(C)-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B =map(int,input().split())
l =[A,A-1,B,B-1]
l.sort()
print(l[0]+l[1])

Submission status: Wrong Answer

Solution code:
a,b=[int(i) for i in input().split()]
print(min([2*a-1,a+b,2*b-1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

a, b = input().split()
a, b = int(a), int(b)
total = 0
if a > b :
  total = 2*a -1 

if b > a:
  total = 2*b-1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import numpy as np
try:
    nums = list(map(int,input('How large is the buttons? ...').split()))
    #print(len(nums))
except:
    print('A,B are an int, 3<=A, B<=20')
    input('How large is the buttons? ... ')
if nums[0] < 3 or nums[1] > 20 or len(nums) != 2:
    print('Type two ints \n A,B are an int, 3<=A, B<=20')
    input('How large is the buttons? ... ')

coins = 0
coins += max(nums)
if nums[0] > nums[1]:
    nums=[nums[0]-1,nums[1]]
else:
    nums=[nums[0],nums[1]-1]

coins += max(nums)

print(coins)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
nums = map(int, raw_input().split())
print 2 * max(nums) - 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
b, c = map(int, input().split())
total = 0;
if(b > c):
  total = b
  b -= 1
else:
  total = c
  c -= 1

if(b > c):
  total = b
  b -= 1
else:
  total = c
  c -= 1

print(total)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
if A>B:
  print("2A-1")
if A<B:
  print("2B-1")
if A==B:
  print("A+B")
A=3
B=5

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def number(x,y):
	a = range(3, 21)
	A = list(a)
	B = list(a)


	if  A[x-2] > B[y-2]:
		MAX=2*x-1
		#print("最大値は"+str(MAX))

	elif   A[x-2] < B[y-2]:
		MAX=2*y-1
		#print("最大値は"+str(MAX))

	elif  A[x-2] == B[y-2]:
		MAX = 2 * x
		#print("最大値は" + str(MAX))

	return MAX

Submission status: Wrong Answer

Solution code:
def number(x,y):
	a = range(3, 21)
	A = list(a)
	B = list(a)


	if  A[x-2] > B[y-2]:
		MAX=2*x-1
		print("最大値は"+str(MAX))

	if  A[x-2] < B[y-2]:
		MAX=2*y-1
		print("最大値は"+str(MAX))

	if  A[x-2] == B[y-2]:
		MAX = 2 * x
		print("最大値は" + str(MAX))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a, b = map(int,sys.stdin.readline().split())
if a == b:
  select_btn = a + b
else:
  select_btn = max(a, b)
print(select_btn*2-1)

Submission status: Wrong Answer

Solution code:
import sys
a, b = map(int, sys.stdin.readline().split())
total = 0
select_botton = max(a, b)
for i in range(2):  
  total += select_botton
  select_botton -= 1
  select_botton = max(select_botton, b)
print(total)

Submission status: Wrong Answer

Solution code:
import sys
a, b = map(int, sys.stdin.readline().split())
total = 0
select_botton = max(a, b)
for i in range(2):  
  total += select_botton
  select_botton -= 1
  select_botton = max(a, b)
print(total)

Submission status: Wrong Answer

Solution code:
import sys
a, b = map(int, sys.stdin.readline().split())
total = 0
for i in range(2):
  select_botton = max(a, b)
  total += select_botton
  select_botton -= 1
print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while tmp<3:
  if A > B:
    cnt+=A
    A-=1
    tmp+=1
  elif A < B:
    cnt+=B
    B-=1
    tmp+=1
  else:
    cnt+=A
    A-=1
    tmp+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
buttons = input().split()
a = int(buttons[0])
b = int(buttons[1])
count = 0

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

print(a)
print(b)
print(count)

Submission status: Wrong Answer

Solution code:
p, q = map(int, input().split())

score = max(p, q) * 2 - 1
print(score)

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
buttons = [int(i) for i in input().split()]
my_max = 0

for i in range(len(buttons)):
    b = buttons[:]
    for j in range(len(buttons)):
        score = b[i]
        b[i] -= 1
        score += b[j]
        my_max = max((score, my_max))

print(my_max)

Submission status: Wrong Answer

Solution code:
aa, bb = list(map(int, input().split()))
if aa>bb:
    print(2*aa+1)
elif aa<bb:
    print(2*bb+1)
else:
    print(2*aa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
a = input()
a = [int(i) for i in a.split()]
ret = 0
ret += max(a)
if a[0] <= a[1]:
    a[0] -= 1
else:
    a[1] -= 1
ret += max(a)
print(ret)

Submission status: Wrong Answer

Solution code:
3

Submission status: Wrong Answer

Solution code:
import numpy as np
x=list(map(int,input().split()))
x=np.array(x)
ma=max(x)
mi=min(x)
b=ma-mi
if b>=2:
    out=ma+ma-1
else:
    out=ma+mi-1
print(out)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
a,b=map(int,input().split())
print(sqrt(a//b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a = s[::2].count('0') + s[1::2].count('1')
print(min(a, len(s)-a))

Submission status: Wrong Answer

Solution code:
S = list(input())
#swt = 0 なら黒、 swt = 1 なら白
def counting(swt):
    cnt = 0
    for i in S:
        if swt == 0 and i == "1":
            i = "0"
            cnt += 1
            swt = 1
        elif swt == 1 and i == "0":
            i = "1"
            cnt += 1
            swt = 0
        else:
            if swt == 0:
                swt = 1
            else:
                swt = 0
    return cnt

print(min(counting(0),counting(1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main(a, b):
    if a==b:
      return a+b
    elif(a>b):
      return 2*a-1
    else:
      return 2*b-1

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())

m = max(A, B)
m = m*2 -1;

print(m)

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())

m = max(A, B)
m = m*2 +1;

print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
buttun = list(map(int,input().split()))
coin = 0
for i in range(1):
  buttun.sort(reverse = True)
  coin +=buttun[0]
  buttun[0]-=1
print(coin)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a_bt, b_bt = map(int, input().split())
result = a_bt > b_bt
sum = a_bt if result else b_bt
result = a_bt - 1 > b_bt if result else a_bt > b_bt - 1
sum += a_bt - 1 if result else b_bt - 1

print(sum)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
t = list(map(int,input().split()))
print(sum(t))

Submission status: Wrong Answer

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

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

print(sum_num)

Submission status: Wrong Answer

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

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

print(sum_num)

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    
    print(A + A -1 if A > B else B + B -1)
   
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#C - Coloring Colorfully
import sys
input = sys.stdin.readline
s = list(input())

cost_0, cost_1 = 0, 0

for i in s[::2]:
	if i == "1":
		cost_0 += 1
for i in s[1::2]:
	if i == "0":
		cost_0 += 1

for i in s[::2]:
	if i == "0":
		cost_1 += 1
for i in s[1::2]:
	if i == "1":
		cost_1 += 1
		 
print(min(cost_0, cost_1))

Submission status: Wrong Answer

Solution code:
def compa(a,b):
    if(a>b):
            return(a)
    else:
            return(b)
smax=0
a,b=map(int,input().split())
smax=smax+compa(a,b)
a=a-1
smax=smax+compa(a,b)

print(smax)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c= int(a)+int(b)
d= int(a)-1 + int(a)
e =int(b)-1 + int(b)

if c > d:
    if c > e:
        print(e)
    else:
        print(e)
else:
    if d > e:
        print(d)
    else:
        print(e)

Submission status: Wrong Answer

Solution code:
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

s, = read_line(str)

# print(s)

c = 0
count_start_0 = 0
for i in range(len(s)):
    if int(s[i]) == c:
        count_start_0 += 1
    c = 0 if c == 1 else 1

count_start_1 = len(s) - count_start_0

print(min([count_start_0, count_start_1]))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

num = 0
if a>=b:
	num = a*(a-1)
else:
	num = b*(b-1)
	
print(num)

Submission status: Wrong Answer

Solution code:
v = input().split();print(sum([max([int(n) for n in v if n])-a for a in [0,1]]))

Submission status: Wrong Answer

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

a=button[0]
b=button[1]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())

if A < B:
    print("{}".format(B + (B - 1)))
elif B > A:
    print("{}".format(A + (A - 1)))
else:
    print("{}".format(A + B))

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())

if A < B:
    print("{}".format(B + B - 1))
elif B > A:
    print("{}".format(A + A - 1))
else:
    print("{}".format(A + B))

Submission status: Wrong Answer

Solution code:
A, B = (int(x) for x in input().split())

if A < B:
    print("{}".format(B + B - 1))
elif B > A:
    print("{}".format(A + A - 1))
else:
    print("{}".format(A + A))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 入力は2つのボタンABの大きさ
# 出力は最大のコイン枚数

x = input().split()
a = int(x[0])  # ボタンAの大きさ
b = int(x[1])  # ボタンBの大きさ


# 大きいほうを結果に加えてー１
def compare_ab(a, b):

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

for i in range(0, 1):

    f = compare_ab(a, b)
    s = compare_ab(a, b)

output = f + s
print(output)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def main():
    i=list(map(int, input().split()))
    c=max(i[0],i[1])
    print(c+(c-1))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
print("hello")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def button(x,y):
  return max(2*x-1, 2*y-1, x+y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(2 * max(list(map(int,input().split()))) - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for _ in range(2):
    print(A, B, max(A, B))
    c += max(A, B)
    if max(A, B) == A:
        A = A - 1
    elif max(A, B) == B:
        B = B - 1

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
res = 0
if a > b:
    res += a
else:
    res += b
res += a - 1 if a > b else b - 1
print("{}".format(res))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
res = 0
res += a if a > b else b
res += a if a > b else b
print("{}".format(res - 1))

Submission status: Wrong Answer

Solution code:
s = input().split()
 
if int(s[0]) < int(s[1]):
  s1 = int(s[0])
  s2 = int(s[1])
else:
  s1 = int(s[1])
  s2 = int(s[0])
  
result = 0
if (s2-s1) > 2:
  result = s2*2 - 1
else:
  result = s2 + s1
 
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())

cnt = 0
new = s[0]
for idx in range(len(s[1:])):
    idx += 1
    if new[idx-1]==s[idx]:
        if s[idx] == '0':
            new+='1'
        else:
            new+='0'
        cnt += 1
    else:
        new+=s[idx]
print(cnt)

Submission status: Wrong Answer

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

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

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def coin(A , B):
  total = 0
  if A < B:
    total += B
    if A < B - 1:
      total += B - 1
    else:
      total += A
  else:
    total += A
    if B < A - 1:
      total += A - 1 
    else:
      total += B

Submission status: Wrong Answer

Solution code:
a=list(input().split())
a.sort()
if int(a[1])!=int(a[0]):
	print (2*int(a[1])-1)
else:
	print (2*int(a[1]))

Submission status: Wrong Answer

Solution code:
a=list(input().split())
a.sort()
print (2*int(a[1])-1)

Submission status: Wrong Answer

Solution code:
a=list(input().split())
a.sort()
print (int(a[1])+int(a[1])-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
S = input()
lis = []
for t in range(len(S)):
    lis.append(S[t])
evencount0 = 0
unevencount0 = 0
evencount1 = 0
unevencount1 = 0
if len(S)%2 == 0:
    for t in range(int(len(S)/2)):
        if S[2*t + 1] == "0":
            evencount0 += 1
    evencount1 = int(len(S)/2) - evencount0
    for t in range(int(len(S)/2)):
        if S[2*t] == "0":
            unevencount0 += 1
    unevencount1 = int(len(S)/2) - unevencount0

else:
    for t in range(int((len(S) - 1)/2)):
        if S[2*t + 1] == "0":
            evencount0 += 1
    evencount1 = int((len(S) - 1)/2) - evencount0        

    for t in range(int((len(S)+1)/2)):
        if S[2*t] == "0":
            unevencount0 += 1
    unevencount1 = int((len(S)+1)/2) - unevencount0

elist = [evencount0 , evencount1 , unevencount0 , unevencount1 ]
if evencount1 + unevencount0 > evencount0 + unevencount1:
    k = evencount0 + unevencount1
else:
    k =evencount1 + unevencount0
print(k)

Submission status: Wrong Answer

Solution code:
import random

List = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]

A = random.sample(List,1)
B = random.sample(List,1)

a = int(A[0])
b = int(B[0])

M = 0
if a == b:
    M = a+b
elif a > b:
    M = a+(a-1)
else:
    M = b+(b-1)

print(M) #M=もらえる最大値

Submission status: Wrong Answer

Solution code:
import random

List = list(range(3,21))

A = random.sample(List,1)
B = random.sample(List,1)

a = int(A[0])
b = int(B[0])

M = 0
if a == b:
    M = a+b
elif a > b:
    M = a+(a-1)
else:
    M = b+(b-1)

print(M) #M=もらえる最大値

Submission status: Wrong Answer

Solution code:
import random

List = list(range(3,21))
print(List)

A = random.sample(List,1)
B = random.sample(List,1)

a = int(A[0])
b = int(B[0])

M = 0
if a == b:
    M = a+b
elif a > b:
    M = a+(a-1)
else:
    M = b+(b-1)

print(M) #M=もらえる最大値