結果

問題 No.1793 実数当てゲーム
ユーザー yudedakoyudedako
提出日時 2022-01-31 00:49:30
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,476 ms / 2,000 ms
コード長 766 bytes
コンパイル時間 8,563 ms
コンパイル使用メモリ 255,972 KB
実行使用メモリ 83,144 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-09-02 01:58:33
合計ジャッジ時間 34,405 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 891 ms
78,048 KB
testcase_01 AC 919 ms
77,628 KB
testcase_02 AC 1,452 ms
82,764 KB
testcase_03 AC 1,450 ms
82,540 KB
testcase_04 AC 1,432 ms
82,000 KB
testcase_05 AC 1,360 ms
81,812 KB
testcase_06 AC 1,351 ms
82,244 KB
testcase_07 AC 1,385 ms
82,436 KB
testcase_08 AC 1,385 ms
82,804 KB
testcase_09 AC 1,384 ms
82,072 KB
testcase_10 AC 1,377 ms
82,492 KB
testcase_11 AC 1,395 ms
83,144 KB
testcase_12 AC 1,476 ms
82,160 KB
testcase_13 AC 1,464 ms
81,188 KB
testcase_14 AC 1,470 ms
82,100 KB
testcase_15 AC 1,442 ms
82,652 KB
testcase_16 AC 1,473 ms
81,540 KB
testcase_17 AC 1,451 ms
82,008 KB
権限があれば一括ダウンロードができます

ソースコード

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


0