codeforces 651A python

来源:互联网 发布:js confirm 标题修改 编辑:程序博客网 时间:2024/05/16 14:48

若两个操纵杆的·电量都为1的话,那么持续时间为0

因此需要特别判断:一个操纵杆电量必须大于1,另一个>=1



joystick = map(int,raw_input().split())result = 0while True:    if (joystick[0] >= 1 and joystick[1] > 1) or (joystick[0]>1 and joystick[1] >=1):        joystick = sorted(joystick)        joystick[0] += 1        joystick[1] -= 2        result += 1    else:        breakprint result