結果

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

ソースコード

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
    print(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