結果
問題 |
No.253 ロウソクの長さ
|
ユーザー |
|
提出日時 | 2015-09-19 02:15:06 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 29.92 |
最終ジャッジ日時 | 2024-07-16 06:15:39 |
合計ジャッジ時間 | 7,291 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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" % (max(0, x - 1))) break l, r = max(0, l - 1), max(0, r - 1)