結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー yuki2006yuki2006
提出日時 2015-07-30 20:50:09
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 508 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 24,396 KB
平均クエリ数 5.60
最終ジャッジ日時 2023-09-23 05:14:32
合計ジャッジ時間 3,556 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
23,832 KB
testcase_01 AC 52 ms
23,532 KB
testcase_02 WA -
testcase_03 AC 51 ms
24,036 KB
testcase_04 AC 50 ms
23,820 KB
testcase_05 AC 51 ms
23,640 KB
testcase_06 AC 53 ms
23,532 KB
testcase_07 AC 51 ms
23,556 KB
testcase_08 AC 52 ms
23,628 KB
testcase_09 WA -
testcase_10 AC 52 ms
24,348 KB
testcase_11 AC 53 ms
23,640 KB
testcase_12 AC 54 ms
23,376 KB
testcase_13 AC 54 ms
23,532 KB
testcase_14 AC 52 ms
24,300 KB
testcase_15 AC 52 ms
24,288 KB
testcase_16 AC 53 ms
23,388 KB
testcase_17 AC 51 ms
24,300 KB
testcase_18 WA -
testcase_19 AC 51 ms
23,628 KB
testcase_20 AC 53 ms
23,364 KB
testcase_21 AC 51 ms
24,324 KB
testcase_22 AC 51 ms
23,424 KB
testcase_23 AC 51 ms
23,388 KB
testcase_24 AC 51 ms
24,000 KB
testcase_25 AC 52 ms
24,396 KB
testcase_26 AC 51 ms
23,364 KB
testcase_27 AC 53 ms
23,412 KB
testcase_28 AC 51 ms
23,808 KB
testcase_29 AC 51 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys


def ex_ceil(A, B):
    return ((A + B - 1) / B) * B


N, K = map(int, raw_input().split())

remain = (N - 1) % (K + 1)

# 0を宣言するかもしれないので、 初期状態を-1にする
current = -1
while True:
    ans = ex_ceil((current - remain), K + 1) + remain

    if ans >= N:
        # かったやつ
        exit(0)
    if ans == current:
        # かてないやつ
        ans += 1

    print ans
    sys.stdout.flush()

    current = int(raw_input())
0