結果

問題 No.456 Millions of Submits!
ユーザー te-shte-sh
提出日時 2017-12-05 17:13:09
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 686 bytes
コンパイル時間 4,185 ms
コンパイル使用メモリ 158,380 KB
実行使用メモリ 162,760 KB
最終ジャッジ日時 2023-09-03 17:12:25
合計ジャッジ時間 13,893 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.math;      // math functions
import std.typecons;  // Tuple, Nullable, BigFlags

void main()
{
  auto m = readln.chomp.to!int;
  foreach (_; 0..m) {
    auto rd = readln.splitter;
    auto a = rd.front.to!int; rd.popFront();
    auto b = rd.front.to!int; rd.popFront();
    auto t = rd.front.to!real;

    auto calc(real n)
    {
      return n ^^ a * log(n) ^^ b - t;
    }

    auto mi = 0.1L, ma = mi;
    while (calc(ma) < 0) ma *= 2;

    auto bsearch = iota(mi, ma, 1.0e-10L).map!(n => tuple(n, calc(n))).assumeSorted!"a[1] < b[1]";
    writefln("%.10f", bsearch.lowerBound(tuple(0, 0)).back[0]);
  }
}
0