結果
問題 |
No.246 質問と回答
|
ユーザー |
![]() |
提出日時 | 2015-08-01 14:32:07 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 377 bytes |
コンパイル時間 | 86 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 28,024 KB |
平均クエリ数 | 1.00 |
最終ジャッジ日時 | 2024-07-16 07:18:15 |
合計ジャッジ時間 | 4,010 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 30 |
ソースコード
import sys import math ans = 0 low = 1 high = 1e9 + 1 mid = (low + high) // 2 + 1 beforemid = 0 while True : mid = (low + high) // 2 print("?", mid) sys.stdout.flush() res = int(input()) if res == 1 : low = mid else : high = mid if math.fabs(beforemid - mid) == 0 : break beforemid = mid if res == 0 : mid = mid - 1 print("!", int(mid)) sys.stdout.flush()