結果
問題 | No.1793 実数当てゲーム |
ユーザー | yudedako |
提出日時 | 2022-01-31 00:46:38 |
言語 | Scala(Beta) (3.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 788 bytes |
コンパイル時間 | 8,835 ms |
コンパイル使用メモリ | 259,896 KB |
実行使用メモリ | 83,020 KB |
平均クエリ数 | 2230.56 |
最終ジャッジ日時 | 2023-09-02 01:57:56 |
合計ジャッジ時間 | 34,441 ms |
ジャッジサーバーID (参考情報) |
judge16 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 891 ms
77,704 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 1,364 ms
82,336 KB |
testcase_06 | AC | 1,378 ms
82,460 KB |
testcase_07 | AC | 1,371 ms
82,172 KB |
testcase_08 | AC | 1,386 ms
82,508 KB |
testcase_09 | AC | 1,389 ms
83,020 KB |
testcase_10 | AC | 1,387 ms
82,868 KB |
testcase_11 | AC | 1,374 ms
83,008 KB |
testcase_12 | AC | 1,440 ms
82,112 KB |
testcase_13 | WA | - |
testcase_14 | AC | 1,476 ms
82,752 KB |
testcase_15 | AC | 1,430 ms
82,200 KB |
testcase_16 | AC | 1,467 ms
82,812 KB |
testcase_17 | AC | 1,434 ms
81,696 KB |
ソースコード
import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.io.StdIn.* import scala.math.* import scala.util.chaining.* @main def main = val testCase = readLine().toInt val maxValue = BigDecimal("1222" + "0" * 72) for _ <- 0 until testCase do var max = log10(12.22 * 0.999991) + 74 var min = log10(0.000009) for _ <- 0 until 24 do val mid = (min + max) / 2 val x = f"${pow(10, mid)}%.15f" println(s"? ${maxValue.min(BigDecimal(x)).formatted("%.15f")}") val response = readLine().trim val yes = response == "Yes" if yes then min = mid else max = mid //println(max - min) println(s"! ${maxValue.min(BigDecimal(f"${pow(10, (min + max) / 2)}%.15f")).formatted("%.15f")}")