結果
| 問題 | No.253 ロウソクの長さ |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2016-05-08 13:12:27 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 107 ms / 2,000 ms |
| コード長 | 481 bytes |
| 記録 | |
| コンパイル時間 | 279 ms |
| コンパイル使用メモリ | 77,364 KB |
| 最終ジャッジ日時 | 2025-12-03 20:40:34 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 36 |
ソースコード
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()
yaoshimax