結果

問題 No.456 Millions of Submits!
ユーザー nebukuro09nebukuro09
提出日時 2016-12-08 10:57:42
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 1,249 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 157,664 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-02 23:25:59
合計ジャッジ時間 8,007 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,376 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
import std.random;
import std.math;
import std.container;
import std.numeric;
import core.bitop;


void main() {
  auto mem = new real[][][](11, 11, 11);
  foreach (a; 1..11)
    foreach (b; 1..11)
      foreach (t; 0..11) {
        real high = 10.0L;
        real low = 1L;
        foreach (i; 0..50) {
          auto mid = (high + low) / 2.0L;
          if (pow(mid, a) * pow(log(mid), b) >= t)
            high = mid;
          else
            low = mid;
        }
        mem[a][b][t] = high;
    }

  auto M = readln.chomp.to!int;
  foreach (m; 0..M) {
    auto s = readln.split;
    auto a = s[0].to!int;
    auto b = s[1].to!int;
    auto t = s[2].to!real;
    if (a == 0)
      writefln("%.10f", pow(E, pow(t, 1.0L/b)));
    else if (b == 0)
      writefln("%.10f", pow(t, 1.0L/a));
    else {
      real high = mem[a][b][t.ceil.to!int];
      real low = mem[a][b][t.floor.to!int];
      foreach (i; 0..20) {
        auto mid = (high + low) / 2.0L;
        if (pow(mid, a) * pow(log(mid), b) >= t)
          high = mid;
        else
          low = mid;
        }
      writefln("%.10f", high);
    }
  }
}
0