結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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
  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 response = readLine().trim
      System.err.println(response)
      val yes = response == "Yes"
      if yes then
        min = mid
      else
        max = mid
    println(f"! ${pow(10, max)}%.15f")


0