結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー 👑 rin204rin204
提出日時 2022-01-20 07:13:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 87,756 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-24 03:02:33
合計ジャッジ時間 5,646 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
86,916 KB
testcase_01 AC 113 ms
87,272 KB
testcase_02 AC 115 ms
86,836 KB
testcase_03 AC 114 ms
87,284 KB
testcase_04 AC 112 ms
87,036 KB
testcase_05 AC 113 ms
86,956 KB
testcase_06 AC 115 ms
87,180 KB
testcase_07 AC 113 ms
87,096 KB
testcase_08 AC 113 ms
87,444 KB
testcase_09 AC 115 ms
87,104 KB
testcase_10 AC 114 ms
87,012 KB
testcase_11 AC 113 ms
86,836 KB
testcase_12 AC 114 ms
87,564 KB
testcase_13 AC 113 ms
87,756 KB
testcase_14 AC 114 ms
87,344 KB
testcase_15 AC 113 ms
87,508 KB
testcase_16 AC 112 ms
86,784 KB
testcase_17 AC 113 ms
87,080 KB
testcase_18 AC 112 ms
87,188 KB
testcase_19 AC 113 ms
86,872 KB
testcase_20 AC 114 ms
86,916 KB
testcase_21 AC 113 ms
87,348 KB
testcase_22 AC 113 ms
86,972 KB
testcase_23 AC 114 ms
87,156 KB
testcase_24 AC 114 ms
87,372 KB
testcase_25 AC 112 ms
87,496 KB
testcase_26 AC 115 ms
86,816 KB
testcase_27 AC 112 ms
87,228 KB
testcase_28 AC 114 ms
87,192 KB
testcase_29 AC 114 ms
87,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
N = n
tot = 0
if (n - 1) % (k + 1) == 0:
    print(0, flush = True)
    a = int(input())
    if a >= N: exit()
    n -= a
    tot += a

while 1:
    x = (n - 1) % (k + 1)
    print(tot + x, flush = True)
    n -= x
    tot += x
    a = int(input())
    if a >= N: exit()
    n -= a - tot
    tot = a
0