結果

問題 No.8 N言っちゃダメゲーム
ユーザー leno
提出日時 2017-08-05 18:35:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 91 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-11 20:38:21
合計ジャッジ時間 1,104 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

def judge(N, K):
    if N <= K+1:
        return True
    tmp = K + 1
    k = 1
    while K * k <= N:
        if N - 1 == tmp * k:
            return False
        k += 1
    return True


if __name__ == '__main__':
    P = int(input())
    for i in range(P):
        N = list(map(int, input().split()))
        if judge(N[0], N[1]):
            print("Win")
        else:
            print("Lose")
0