結果

問題 No.253 ロウソクの長さ
ユーザー yaoshimaxyaoshimax
提出日時 2016-05-08 13:12:27
言語 Python2
(2.7.18)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 24,384 KB
平均クエリ数 21.47
最終ジャッジ日時 2023-09-23 23:51:10
合計ジャッジ時間 3,299 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
24,024 KB
testcase_01 AC 27 ms
23,400 KB
testcase_02 AC 27 ms
23,988 KB
testcase_03 AC 28 ms
23,604 KB
testcase_04 AC 29 ms
23,256 KB
testcase_05 AC 28 ms
24,384 KB
testcase_06 AC 31 ms
23,808 KB
testcase_07 AC 29 ms
23,424 KB
testcase_08 AC 28 ms
23,208 KB
testcase_09 AC 28 ms
23,544 KB
testcase_10 AC 29 ms
23,952 KB
testcase_11 AC 32 ms
23,676 KB
testcase_12 AC 31 ms
23,352 KB
testcase_13 AC 31 ms
23,352 KB
testcase_14 AC 28 ms
23,364 KB
testcase_15 AC 28 ms
23,352 KB
testcase_16 AC 28 ms
23,556 KB
testcase_17 AC 28 ms
24,204 KB
testcase_18 AC 29 ms
23,484 KB
testcase_19 AC 28 ms
23,556 KB
testcase_20 AC 30 ms
23,508 KB
testcase_21 AC 28 ms
23,424 KB
testcase_22 AC 28 ms
23,376 KB
testcase_23 AC 28 ms
23,832 KB
testcase_24 AC 28 ms
23,676 KB
testcase_25 AC 28 ms
23,328 KB
testcase_26 AC 28 ms
24,060 KB
testcase_27 AC 30 ms
24,384 KB
testcase_28 AC 28 ms
24,360 KB
testcase_29 AC 31 ms
23,640 KB
testcase_30 AC 28 ms
24,048 KB
testcase_31 AC 28 ms
24,000 KB
testcase_32 AC 28 ms
23,808 KB
testcase_33 AC 28 ms
23,784 KB
testcase_34 AC 28 ms
23,400 KB
testcase_35 AC 31 ms
23,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

left=10
right=1000000001
print "? %d" % 512
sys.stdout.flush()
res=int(raw_input())
if res>0:
    left=513
elif res<0:
    right=511
else:
    print "! %d" % 512
    sys.stdout.flush()
    exit()

t=1
while left < right:
    mid=(left+right)/2
    print "? %d" % (mid-t)
    sys.stdout.flush()
    res=int(raw_input())
    if res>0:
        left=mid+1
    elif res<0:
        right=mid-1
    else:
        left=right=mid
    t+=1
print "! %d" % left
sys.stdout.flush()
0