結果
問題 |
No.253 ロウソクの長さ
|
ユーザー |
![]() |
提出日時 | 2015-08-01 17:06:58 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 758 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,864 KB |
平均クエリ数 | 30.31 |
最終ジャッジ日時 | 2024-07-16 05:27:37 |
合計ジャッジ時間 | 4,871 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 WA * 6 |
ソースコード
import sys import math def question(num): print("? %d" % num) sys.stdout.flush() n = int(input()) return n def result(num): print("! %d" % num) sys.stdout.flush() # main max_num = 1e9 judge = int(max_num / 2) min_num = 10 for i in range(0,29): r = question(judge) if r == 1: # higer min_num = judge elif r == -1: # low max_num = judge else: result(judge + i) sys.exit() max_num -= 1 min_num -= 1 max_num = max_num if max_num >= 0 else 0 min_num = min_num if min_num >= 0 else 0 judge = int((max_num - min_num) / 2) + min_num judge = min_num for i in range(29,100): r = question(judge) if r == 0: result(judge + i) break