結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー yuki2006yuki2006
提出日時 2015-07-30 21:12:54
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 512 bytes
コンパイル時間 758 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 24,324 KB
平均クエリ数 5.60
最終ジャッジ日時 2023-09-23 05:14:47
合計ジャッジ時間 3,423 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
23,424 KB
testcase_01 AC 53 ms
24,036 KB
testcase_02 WA -
testcase_03 AC 53 ms
23,400 KB
testcase_04 AC 54 ms
23,700 KB
testcase_05 AC 51 ms
24,084 KB
testcase_06 AC 51 ms
24,312 KB
testcase_07 AC 52 ms
24,324 KB
testcase_08 AC 52 ms
24,252 KB
testcase_09 WA -
testcase_10 AC 53 ms
23,388 KB
testcase_11 AC 54 ms
23,640 KB
testcase_12 AC 51 ms
23,460 KB
testcase_13 AC 51 ms
23,880 KB
testcase_14 AC 53 ms
24,288 KB
testcase_15 AC 52 ms
24,300 KB
testcase_16 AC 51 ms
24,036 KB
testcase_17 AC 52 ms
24,024 KB
testcase_18 WA -
testcase_19 AC 52 ms
23,424 KB
testcase_20 AC 54 ms
23,556 KB
testcase_21 AC 53 ms
24,072 KB
testcase_22 AC 52 ms
24,024 KB
testcase_23 AC 52 ms
23,676 KB
testcase_24 AC 52 ms
23,712 KB
testcase_25 AC 52 ms
23,844 KB
testcase_26 AC 53 ms
23,652 KB
testcase_27 AC 54 ms
23,424 KB
testcase_28 AC 52 ms
23,436 KB
testcase_29 AC 53 ms
24,240 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 == current:
        # かてないやつ
        ans += 1

    print ans
    sys.stdout.flush()

    current = int(raw_input())
    if current >= N:
        # かったやつ
        exit(0)
0