BOJ - 13343 - Block Game

Updated:

import sys

def GCD(A, B):
    if A > B: A, B = B, A
    if B % A == 0: return True
    if (B - A) < A: return not GCD(B - A, A)
    return True

def solution():
    A, B = map(int, sys.stdin.readline().split())
    print("win" if GCD(A, B) else "lose")

solution()

https://www.acmicpc.net/problem/13343

Categories:

Updated:

Leave a comment