結果

問題 No.1793 実数当てゲーム
ユーザー yudedakoyudedako
提出日時 2022-01-31 00:16:33
言語 Scala(Beta)
(3.4.0)
結果
RE  
実行時間 -
コード長 728 bytes
コンパイル時間 9,514 ms
コンパイル使用メモリ 251,944 KB
実行使用メモリ 78,636 KB
平均クエリ数 1.00
最終ジャッジ日時 2024-06-11 08:34:08
合計ジャッジ時間 23,397 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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) + 74
    var min = -10.0
    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(s"! ${maxValue.min(BigDecimal(f"${pow(10, max)}%.15f")).formatted("%.15f")}")


0