結果

問題 No.1314 N言っちゃダメゲーム (5)
ユーザー LyricalMaestro
提出日時 2024-01-09 00:48:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 54,028 KB
最終ジャッジ日時 2024-09-27 19:45:49
合計ジャッジ時間 2,565 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://yukicoder.me/problems/no/1314

def main():
    M, K = map(int, input().split())

    # Nが決まった時のGrandy数は (N - 1) mod (K + 1)となるため、
    # この値が0となりうるNの数を計算する

    z = (M - 1) // (K + 1)
    l = M - 1 - z

    if l % 2 == 0 and z % 2 == 0:
        print("Draw")
    elif l % 2 != 0 and z % 2 == 0:
        print("Win")
    elif l % 2 == 0 and z % 2 != 0:
        print("Lose")
    else:
        print("Win")
 



if __name__ == "__main__":
    main()
0