結果
| 問題 | No.253 ロウソクの長さ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-09-19 02:15:40 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 77,576 KB |
| 最終ジャッジ日時 | 2025-12-03 17:05:10 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 36 |
ソースコード
import sys
def puts(s):
print s
sys.stdout.flush()
l, r = 10, 10 ** 9
while 1:
x = (l + r) / 2
puts("? %d" % x)
reply = int(raw_input())
if reply == 1:
l = x + 1
if reply == -1:
r = x - 1
if reply == 0:
puts("! %d" % x)
break
l, r = max(0, l - 1), max(0, r - 1)