結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー rlangevinrlangevin
提出日時 2023-01-14 15:13:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 87,764 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-24 03:08:40
合計ジャッジ時間 5,543 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
86,916 KB
testcase_01 AC 113 ms
86,948 KB
testcase_02 AC 116 ms
86,948 KB
testcase_03 AC 114 ms
87,584 KB
testcase_04 AC 116 ms
86,832 KB
testcase_05 AC 116 ms
87,276 KB
testcase_06 AC 116 ms
87,248 KB
testcase_07 AC 112 ms
87,160 KB
testcase_08 AC 111 ms
87,360 KB
testcase_09 AC 113 ms
87,512 KB
testcase_10 AC 113 ms
87,616 KB
testcase_11 AC 113 ms
87,316 KB
testcase_12 AC 114 ms
87,236 KB
testcase_13 AC 114 ms
87,660 KB
testcase_14 AC 112 ms
87,008 KB
testcase_15 AC 114 ms
87,216 KB
testcase_16 AC 113 ms
87,428 KB
testcase_17 AC 112 ms
87,540 KB
testcase_18 AC 112 ms
87,380 KB
testcase_19 AC 111 ms
87,212 KB
testcase_20 AC 112 ms
87,564 KB
testcase_21 AC 112 ms
87,764 KB
testcase_22 AC 113 ms
87,328 KB
testcase_23 AC 114 ms
87,316 KB
testcase_24 AC 112 ms
87,488 KB
testcase_25 AC 113 ms
87,260 KB
testcase_26 AC 112 ms
87,436 KB
testcase_27 AC 113 ms
87,152 KB
testcase_28 AC 112 ms
87,664 KB
testcase_29 AC 113 ms
87,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N, K = map(int, input().split())
if K >= N - 1:
    print(N - 1)
    sys.stdout.flush()
    exit()
now = (N - 1) % (K + 1)
print(now)
sys.stdout.flush()
while True:
    v = int(input())
    if v >= N:
        exit()
    nex = K + 1 - (v - now) % (K + 1)
    now = v + nex
    print(now)
    sys.stdout.flush()
0