結果

問題 No.1770 N言っちゃダメゲーム (6)
ユーザー tamatotamato
提出日時 2021-12-02 21:38:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 71,412 KB
最終ジャッジ日時 2023-09-18 10:38:41
合計ジャッジ時間 5,522 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,188 KB
testcase_01 AC 71 ms
70,896 KB
testcase_02 AC 70 ms
71,092 KB
testcase_03 AC 72 ms
71,240 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 70 ms
71,096 KB
testcase_07 AC 72 ms
71,204 KB
testcase_08 AC 71 ms
71,076 KB
testcase_09 AC 71 ms
71,108 KB
testcase_10 AC 72 ms
71,188 KB
testcase_11 AC 71 ms
71,184 KB
testcase_12 AC 72 ms
71,124 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 71 ms
71,288 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 70 ms
71,204 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 70 ms
71,252 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 71 ms
71,304 KB
testcase_36 AC 71 ms
70,796 KB
testcase_37 AC 72 ms
71,244 KB
testcase_38 AC 74 ms
71,100 KB
testcase_39 AC 72 ms
71,152 KB
testcase_40 AC 71 ms
70,968 KB
testcase_41 AC 72 ms
71,412 KB
testcase_42 AC 73 ms
70,904 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
if K & 1:
    if N % (K+2) == 1:
        print(0)
    else:
        if K == N-1:
            print(K)
            exit()
        a = (N - 1) % (K + 2)
        if a & 1:
            print(a)
        else:
            print(a // 2)
            print(a)
else:
    if N % (K+1) == 1:
        print(0)
    else:
        a = (N - 1) % (K + 1)
        if a & 1:
            print(a)
        else:
            print(a // 2)
            print(a)
0