結果

問題 No.246 質問と回答
ユーザー ssmkzkssmkzk
提出日時 2018-11-28 09:45:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 24,412 KB
平均クエリ数 33.30
最終ジャッジ日時 2023-09-23 20:30:06
合計ジャッジ時間 3,959 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,836 KB
testcase_01 AC 54 ms
24,328 KB
testcase_02 AC 53 ms
24,276 KB
testcase_03 AC 54 ms
24,412 KB
testcase_04 AC 55 ms
24,228 KB
testcase_05 AC 54 ms
23,852 KB
testcase_06 AC 54 ms
24,224 KB
testcase_07 AC 54 ms
23,820 KB
testcase_08 AC 53 ms
23,864 KB
testcase_09 AC 53 ms
23,772 KB
testcase_10 AC 53 ms
23,972 KB
testcase_11 AC 53 ms
24,368 KB
testcase_12 AC 55 ms
23,960 KB
testcase_13 AC 54 ms
24,032 KB
testcase_14 AC 55 ms
23,792 KB
testcase_15 AC 55 ms
23,752 KB
testcase_16 AC 55 ms
24,024 KB
testcase_17 AC 54 ms
23,792 KB
testcase_18 AC 54 ms
23,920 KB
testcase_19 AC 55 ms
23,708 KB
testcase_20 AC 54 ms
24,068 KB
testcase_21 AC 53 ms
24,216 KB
testcase_22 AC 55 ms
24,192 KB
testcase_23 AC 54 ms
24,204 KB
testcase_24 AC 53 ms
23,704 KB
testcase_25 AC 54 ms
23,788 KB
testcase_26 AC 55 ms
24,288 KB
testcase_27 AC 55 ms
24,164 KB
testcase_28 AC 55 ms
24,260 KB
testcase_29 AC 56 ms
23,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

max_num = 1000000000
ck_num = max_num // 2
span = max_num // 2

while True:
    print("?",ck_num)
    ans = int(input())
    span = span // 2
    if ans == 1:
        ck_num += span
    else:
        ck_num -= span
    if span == 1:
        break

ck_num -= 3
for i in range(10):
    print("?", ck_num)
    ans = int(input())
    if ans == 1:
        ck_num += 1
    else:
        print("!", ck_num - 1)
        sys.exit()
0