結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー roiti46roiti46
提出日時 2015-07-31 23:10:29
言語 Python2
(2.7.18)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 6,652 KB
実行使用メモリ 24,360 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-23 21:07:22
合計ジャッジ時間 3,528 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
23,412 KB
testcase_01 AC 58 ms
23,880 KB
testcase_02 AC 53 ms
23,604 KB
testcase_03 AC 54 ms
23,856 KB
testcase_04 AC 54 ms
23,676 KB
testcase_05 AC 55 ms
24,336 KB
testcase_06 AC 56 ms
23,436 KB
testcase_07 AC 56 ms
23,712 KB
testcase_08 AC 56 ms
23,856 KB
testcase_09 AC 54 ms
24,276 KB
testcase_10 AC 54 ms
23,436 KB
testcase_11 AC 54 ms
23,616 KB
testcase_12 AC 55 ms
23,688 KB
testcase_13 AC 55 ms
23,424 KB
testcase_14 AC 55 ms
24,084 KB
testcase_15 AC 56 ms
23,688 KB
testcase_16 AC 56 ms
24,084 KB
testcase_17 AC 56 ms
24,360 KB
testcase_18 AC 56 ms
23,412 KB
testcase_19 AC 54 ms
23,712 KB
testcase_20 AC 56 ms
24,300 KB
testcase_21 AC 54 ms
23,460 KB
testcase_22 AC 54 ms
24,120 KB
testcase_23 AC 52 ms
23,676 KB
testcase_24 AC 54 ms
24,000 KB
testcase_25 AC 55 ms
23,472 KB
testcase_26 AC 53 ms
23,460 KB
testcase_27 AC 55 ms
23,448 KB
testcase_28 AC 56 ms
23,400 KB
testcase_29 AC 55 ms
24,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
N, K = map(int, raw_input().split())
n = N
cur = 0
while n - (K + 1) > 0:
    n -= K + 1
if n == 1:
    print 0
    sys.stdout.flush()
else:
    print n - 1
    cur = n - 1
    sys.stdout.flush()


while 1:
    B = int(raw_input())
    if B >= N: break
    d = B - cur
    cur = min(N - 1, B + (K + 1 - d))
    print cur
    sys.stdout.flush()
0