|
|
back to boardWhy WA 5 help please Posted by ivan228 14 Oct 2018 23:00 import sys n,m=map(int,input().split()) n1=n m1=m j=0 ans=0 if n1==1 or m1 ==1: print(0) sys.exit() while n1>0 and m1>0: if ans%2==0 and j!=0: if m1>0: m1-=1 ans+=1 j+=1 else: print(ans) sys.exit() elif ans%2==1 and j!=0: if n1>0: n1-=1 ans+=1 j+=1 else: n1-=1 m1-=1 ans+=1 j+=1 print(ans) |
|
|