結果

問題 No.1793 実数当てゲーム
ユーザー yudedakoyudedako
提出日時 2022-01-31 00:00:33
言語 Scala(Beta)
(3.4.0)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 7,366 ms
コンパイル使用メモリ 259,136 KB
実行使用メモリ 80,684 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-09-02 01:52:55
合計ジャッジ時間 32,061 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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
  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 = pow(10, mid)
      println(f"? $x%.15f")
      val yes = readLine() == "Yes"
      if yes then
        max = mid
      else
        min = mid
    println(f"! ${pow(10, max)}%.15f")


0