結果
| 問題 | No.253 ロウソクの長さ |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2016-05-08 13:10:06 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 482 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 77,620 KB |
| 最終ジャッジ日時 | 2025-12-03 20:40:27 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 RE * 21 |
ソースコード
import sys
left=10
right=10000000000
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