보안을 그리다, 훈이

[Baekjoon/Python3] 12756번 고급 여관 본문

Programming/Python & Data Structures

[Baekjoon/Python3] 12756번 고급 여관

HooNeee 2020. 12. 7. 01:08

[Baekjoon/Python3] 12756번 고급 여관

 

www.acmicpc.net/problem/12756

 

12756번: 고급 여관

플레이어 A의 카드가 남아있다면 "PLAYER A"를, 플레이어 B의 카드가 남아있다면 "PLAYER B"를 출력한다. 모두 죽은 상태라면 "DRAW"를 따옴표 없이 출력한다.

www.acmicpc.net

 

a_power, a_life = map(int, input().split())
b_power, b_life = map(int, input().split())
while True:
    a_life -= b_power
    b_life -= a_power
    if a_life <= 0 and b_life <= 0:
        print('DRAW')
        break
    elif a_life <= 0:
        print('PLAYER B')
        break
    elif b_life <= 0:
        print('PLAYER A')
        break
Comments