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: Runtime Error

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

Submission status: Runtime Error

Solution code:
array=[A,B]
results=[]
for i in range(2):
  for j in range(2):
    results.append(array[i]+array[j])
    array[i]-=1
    array[j]-=1
result=min(results)

return result

Submission status: Runtime Error

Solution code:
s = list(input())
N = len(s)
cont = 0
for i in xrange(1,N):
    if s[i-1]==s[i]:
        cont += 1
        if s[i] == '0':
            del s[i]
            s.insert(i, '1')          
        else:
            del s[i]
            s.insert(i, '0')    
print(cont)

Submission status: Runtime Error

Solution code:
def calc(x):
    global mount
    global list
    count=0
    for y in range(1,x+1):
        if mount[x] >= mount[x-y]:
            count+=1
    if x == count:
        list.append(x)

N=int(input())

mount=input().split()

list=[]

for z in range(1,len(mount)):
    calc(z)

print(1+len(list))

Submission status: Runtime Error

Solution code:
N, K = list(map(int, input().split(' ')))
S = list(input())

li = []
size = []

now = S[0]
cnt = 1

for i in range(1,N,1):
  before = now
  now = S[i]
  if now == before:
    cnt += 1
  else:
    li.append(before)
    size.append(cnt)
    cnt = 1

li.append(now)
size.append(cnt)

if 3*K > len(size):
  print(sum(size))
  END = True

max_sum = 0

if END:
  pass
else:
  for i in range(K):
    try:
      now_sum = sum(size[i:i+3*K])
      if max_sum < now_sum:
          max_sum = now_sum
    except:
      pass

  print(max_sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
H=list(map(int,input().split()))
num_an=1
tmp=H[0]
for i in range(len(H)-1):
	if tmp>=H[i+1]:
		num_an+=1
	else:
		tmp=H[i+1]
print(num_an)

Submission status: Runtime Error

Solution code:
N = int(input())
H = input().split()
i = int(0)
j = int(0)
n = int(1)
m = int(0)
for i in range(N-1):
    for j in range(i+1):
        if H[i] >= H[j]:
            m = m + 1
    if m == i+1:
        n = n + 1
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = [int(i) for i in input().split()]~


output = max(a)

b = a.index(max(a))

a[b] = a[b] - 1

output = output + max(a)

print(output)

Submission status: Runtime Error

Solution code:
import random
A, B = map(int, input().split())
r = random.randrange(5)
if r == 0:
    print(1/0)
elif r == 1:
    print(A+B)
elif r == 2:
    while True:
        B += 1
elif r == 3:
    print(999)
else:
    X = [[0] * 10**4 for _ in range(10**5)]

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2+1]))

print(ans)

Submission status: Runtime Error

Solution code:
import random
A, B = map(int, input().split())
r = random.randrange(5)
if r == 0:
    print(1/0)
elif r == 1:
    print(A+B)
elif r == 2:
    while True:
        B += 1
else:
    X = [0] * (10**9)

Submission status: Runtime Error

Solution code:
N, K = [int(c) for c in input().split()]
S = [int(c) for c in input()]

longest=0

for bgn_flip in range(len(S)):

    S_copy=S[:]
    zero=False
    icluster=-1
    for i,s in enumerate(S):
        if s==0 and zero==False:
            zero=True
            icluster+=1
        if s==1:
            zero=False

        if s==0 and icluster>=bgn_flip and icluster < bgn_flip+K:
       	    S_copy[i]=1

    seq=0
    for sc in S_copy:
        if sc==1: seq+=1
        if sc==0: seq=0
        if seq>longest:longest=seq

print(longest)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy

s = list(input())
N = len(s)
count_A = 0
count_B = 0

for i in range(N):
    s[i] = int(str(s[i]))

A = numpy.empty(N)
B = numpy.empty(N)

for j in range(N):
    if j % 2 == 0 :
        A[j] = 1
        B[j] = 0
    else:
        A[j] = 0
        B[j] = 1

for k in range(N):
    A[k]=s[k]-A[k]
    B[k]=s[k]-B[k]
    if A[k] != 0:
        count_A = count_A + 1
    if B[k] != 0:
        count_B = count_B + 1

if count_A > count_B :
    print(count_B)
else :
    print(count_A)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
h = list(map(int,input().split()))
h1 = h[0]
hi = h[-1]
hi2 = h[-2]
count = 0
ans = [count + 1 for t in h if t >= h1]
if hi2 > hi and hi2 >= h1:
    ans -= 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import random
A, B = map(int, input().split())
r = random.randrange(5)
if r == 0:
    print(1/0)
elif r == 1:
    print(A+B)
elif r == 2:
    while True:
        B += 1
else:
    X = []
    for i in range(10**6):
	    X += [a for a in range(1000)]

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import random
A, B = map(int, input().split())
r = random.randrange(5)
if r == 0:
    print(1/0)
elif r == 1:
    print(A+B)
elif r == 2:
    while True:
        B += 1
elif r == 3:
    print(999)
else:
    X = [0] * 10**9

Submission status: Runtime Error

Solution code:
n=input()
h = list(map(int,input().split()))
h1 = h[0]
hi = h[-1]
hi2 = h[-2]
count = 0
for takasa in h:
    if takasa >= h1:
        count+= 1
if hi2 > hi and hi2 >= h1:
    count -= 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
B = input()

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

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

else :
    X = B
    B = B - 1

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

print(X)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
 
score = 0
for i in range(2):
  if A >= 3 and A > B:
    score += A
    A = A - 1
 
  elif B <= 20 and B < A:
    score += B
    B = B - 1

print(score)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

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

  elif b <= 20 and b < a:
    score += b
    b = b - 1

print(score)

Submission status: Runtime Error

Solution code:
N = int(input())
H = list(map(int, input().split()))
count = 0

for i in range(N):
    if H[0] <= H[i]:
        count += 1
        if H[i] <= H[i-1]:
            count -= 1
print(count if H[0] >= H[i] else count + 1)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())


score = 0
for i in range(2):
  if a >= 3 and a > b:
    score += a
    a = a - 1
 
  elif b <= 20 and b < a:
    score += b
    b = b - 1
    
print(score)

Submission status: Runtime Error

Solution code:
A = input()
B = input()

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

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

else :
    X = B
    B = B - 1

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

print(X)

Submission status: Runtime Error

Solution code:
N = input()
H = [s for s in input().split()]

HIEST = H[0]
COUNT = 0
for i in H:

    if i >= HIEST:
        HIEST = i
        COUNT = COUNT+1

print(COUNT)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = 0
b = 0
a = int(input())
b = int(input())
 
 
if a>=b:
  c = a
  d = a - 1
  f = b
if a<b:
  c = b
  d = b - 1
  f = a
  
if d>=f:
  c += d
if d<f:
  c += f
  
print(c)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
ans = 0
if a < b:
    ans += b
    b = b-1
else:
    ans += a
    a = a-1
if a < b:
    ans += b
    b = b-1
else:
    ans += a
    a = a-1 
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
b = list(map(int, input().split()))
mostHeight =b[0]
count = 0
for i in b:
    if(i >= mostHeight):
        mostHeight = i
        count += 1
print(count)

Submission status: Runtime Error

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: Runtime Error

Solution code:
a = int(input())
b = int(input())
ans = 0
if a < b:
    ans += b
    b = b-1
else:
    ans += a
    a = a-1
if a < b:
    ans += b
    b = b-1
else:
    ans += a
    a = a-1 
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
b = [map(int, input().split())]
mostHeight =b[0]
count = 0
for i in b:
    if(i >= mostHeight):
        mostHeight = i
        count += 1
print(count)

Submission status: Runtime Error

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	a,b = map(int, io().split())
	if a==b:
		ret==2*a
	else:
		c=max(a,b)
		ret=2*c-1

	return ret

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
A = input()
B = input()

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

print(X)

Submission status: Runtime Error

Solution code:
a =input()
b = [map(int, input().split())]
mostHeight =b[0]
count = 0
for i in b:
    if(i >= mostHeight):
        mostHeight = i
        count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input a
input b
ans = 0
if a < b:
    ans += b
    b = b-1
else:
    ans += a
    a = a-1
if a < b:
    ans += b
    b = b-1
else:
    ans += a
    a = a-1 
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
 
 
if a>=b:
  c = a
  d = a - 1
  f = b
if a<b:
  c = b
  d = b - 1
  f = a
  
if d>=f:
  c += d
if d<f:
  c += f
  
print(c)

Submission status: Runtime Error

Solution code:
arr = (input()).split()

for i,temp in enumerate(arr):
  arr[i] = int(arr[i])
  
result = 0
for i in range(2):
  result += max(arr)
  index = arr.index(mac(arr))
  arr[index] = arr[index] -1
  
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding:utf-8
n = int(input())
h = list(map(int, input().split()))
counter = 1

#一番西がもっとも高い山ならその時点で終了
if max(h) == h[0]:
    print(counter)
else:
    for i in range(n):
        print(h[0:i+1])
        h_max = max(h[0:i+1])
        if (h[i] >= h_max) and (h[i] > h[0]):
            #print(h[i])
            counter += 1
    print(counter)

Submission status: Runtime Error

Solution code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 1:
    num+= 1
    continue
  for B in range(A + 1):
    if (H[A]) < (H[B]):
      tf = 0
  if tf:
    num += 1
print("{}\n".format(num))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 1:
    num+= 1
    continue
  for B in range(A + 1):
    if (H[A]) < (H[B]):
      tf = 0
  if tf:
    num += 1
print("{} \n", num)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Hlist = [int(x) for x in input().split()]

count = 0
for i in range (N):
    if Hlist[i] >= max(Hlist[0:i+1]):
        count+= 1

print(count)

Submission status: Runtime Error

Solution code:
input_a = input()
if input_a >= 3:
  a = int(input_a)

input_b = input()
if input_b <= 20:
  b = int(input_b)

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
 
 
if a>=b:
  c = a
  d = a - 1
  f = b
if a<b:
  c = b
  d = b - 1
  f = a
 
if d>=f:
  c += d
if d<f:
  c += f
  
print(c)

Submission status: Runtime Error

Solution code:
A = input()
B = input()
sum = 0
i = 0
for i in range(2):
  if A>=B:
    sum = sum + A
    A = A - 1
  else:
    sum = sum + B
    B = B - 1
    
print(sum)

Submission status: Runtime Error

Solution code:
a = input()
b = input()

 
if a>=b:
  c = a
  d = a - 1
  f = b
if a<b:
  c = b
  d = b - 1
  f = a

if d>=f:
  c += d
if d<f:
  c += f
  
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x int(input().split()))
if a-b!=0:
  t=max(a,b)
  print(2*t-1)
else:
  print(a+b)

Submission status: Runtime Error

Solution code:
hpi = input()
count = 1
k = list(map(int, input().split(" ")))
for c in range(int(hpi) - 1):
  jo = "yes"
  n = k[:c + 2]
  for co in range(len(n) - 1):
    if n[co] > k[c + 1]:
      jo = "no"
    else:
      pass
  if jo == "yes":
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
input_a = input("Aは？")
if input_a >= 3:
  a = int(input_a)

input_b = input("Bは？")
if input_b <= 20:
  b = int(input_b)

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

  else:
    score += b
    b = b - 1
    
print(score)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
i = 0
X = 0
if(A != B):
    while i <= 1: 
        X += max(A,B)
        i += 1
    print(X-1)
else:
print(A + B)

Submission status: Runtime Error

Solution code:
#coding:utf-8

if __name__ == "__main__":
    N = int(input())
    tmp = input().split()
    Hs = []
    for t in tmp:
        Hs.append(int(t))
    total = 0

    for n in range(N):
        n_count = 0
        for i in range(0, n):
            if Hs[i] > Hs[n]:
                break
            n_count += 1
        if n_count == n:
            total += 1
        
    print("\n"+str(total))

Submission status: Runtime Error

Solution code:
hpi = input()
k = list(map(int, input().split(" ")))
for c in range(int(hpi) - 1):
  jo = "yes"
  n = k[:c + 2]
  for co in range(len(n) - 1):
    if n[co] > k[c + 1]:
      jo = "no"
    else:
      pass
  if jo == "yes":
    count += 1
print(count + 1)

Submission status: Runtime Error

Solution code:
#coding:utf-8

if __name__ == "__main__":
    N = int(input())
    tmp = input().split()
    Hs = []
    for t in tmp:
        Hs.append(int(t))
    total = 0

    for n in range(N):
        n_count = 0
        for i in range(0, n):
            if Hs[i] > Hs[n]:
                break
            n_count += 1
        if n_count == n:
            total += 1
        
    print(str(total)+"\n")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
b=input()
if a<=b:
  s=b
  b=-1+b
else:
  s=a
  a=-1+a
if a<=b:
  t=b
else:
  t=a
print(s+t)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
d = 0
e = 0
 
if a>=b:
  c = a
  d = a - 1
  f = b
if a<b:
  c = b
  e = b - 1
  f = a
if d>f:
  c += d
if d<f:
  c += f
if e>f:
  c += e
if e<f:
  c += f
  
print(c)

Submission status: Runtime Error

Solution code:
#coding:utf-8

if __name__ == "__main__":
    N = int(input())
    tmp = input().split()
    Hs = []
    for t in tmp:
        Hs.append(int(t))
    total = 0

    for n in range(N):
        n_count = 0
        for i in range(0, n):
            if Hs[i] > Hs[n]:
                break
            n_count += 1
        if n_count == n:
            total += 1
        
    print(total)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
d = 0
e = 0

if a>=b:
  c = a
  d = a - 1
  f = b
if a<b:
  c = b
  e = b - 1
  f = a
if d>f:
  c += d
if d<f:
  c += f
if e>f:
  c += e
if e<f:
  c += f

Submission status: Runtime Error

Solution code:
6 6

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
coin = 0
for i in range(0,2):
    if a > b:
        coin += a
        a = a-1
    elif b > a:
        coin += b
        b = b-1
    else:
        coin += a
        a = a-1
print(coin)

Submission status: Runtime Error

Solution code:
w = input().split()

a = w[0]
b = w[1]

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

print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
a=input()
b=input()
a=int(a)
b=int(b)
c=a+a-1
d=a+b
e=b+b-1
m=c
if m<e:
    m=e
if m<d:
    m=d
if m<0:
    print(0)
    sys.exit()
print(str(m))

Submission status: Runtime Error

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

print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

inp: str = input()

input_list = inp.split()

a = int(input_list[0])
b = int(input_list[1])

count = 0

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

print(count)

Submission status: Runtime Error

Solution code:
btns=input().split()
X=btns[0]
Y=btns[1]
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Submission status: Runtime Error

Solution code:
import sys
a=int(input())
b=int(input())
c=a+a-1
d=a+b
e=b+b-1
m=c
if m<e:
    m=e
if m<d:
    m=d
if m<0:
    print(0)
    sys.exit()
print(str(m))

Submission status: Runtime Error

Solution code:
20 20

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int,input().split()))
ans = 1
for i in range(1,n):
    flag = 1
    for j in range(i):
        if h[j] > h[i]:
            flag = 0
            break
        else:
            pass
    if flag:
        ans += 1
print(ans)

Submission status: Runtime Error

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: Runtime Error

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

_count=1
max_height=H[0]

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

Submission status: Runtime Error

Solution code:
import sys
btns = sys.stdin.readline().split()
X=btns[0]
Y=btns[1]
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Submission status: Runtime Error

Solution code:
#coding:utf-8

import sys
import numpy as np

a = int(sys.argv[1])
b = int(sys.argv[2])

max_number = np.array([a+b,2*a-1,2*b-1]).max()
print(max_number)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split(' ')))
l.sort()
tmp = l[1]
if (l[1]-1>l[0]):
    print(l[1]+l[0])
else if(l[1]=l[0]):
    print(l[0]+l[1]) 
else :
    print(l[1]*2-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
import sys

btns = sys.stdin.readline().split()
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=a+a-1
d=a+b
e=b+b-1
m=c
if m<e:
    m=e
if m<d:
    m=d
print(str(m))

Submission status: Runtime Error

Solution code:
n = int(input())
h = [int(a) for a in input().split()]

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

print(result)

Submission status: Runtime Error

Solution code:
#https://atcoder.jp/contests/abc124
# -*- coding: utf-8 -*-

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
B = input()
sum = 0
i = 0
for i in range(1):
  if A>=B:
    sum = sum + A
    A = A - 1
  else:
    sum = sum + B
    B = B - 1
    
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

r+=max(A,B)
print(r)

Submission status: Runtime Error

Solution code:
A,B=gets.chomp.split(" ").map(&:to_i);
if A == B
    print(2 * A)
elsif A > B
    print(2 * A - 1)
else
    print(2 * B -1)
end

Submission status: Runtime Error

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