結果
問題 |
No.456 Millions of Submits!
|
ユーザー |
|
提出日時 | 2017-12-06 14:00:19 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 1,508 ms / 4,500 ms |
コード長 | 816 bytes |
コンパイル時間 | 2,771 ms |
コンパイル使用メモリ | 150,656 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 22:49:41 |
合計ジャッジ時間 | 10,941 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
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!real; rd.popFront(); auto b = rd.front.to!real; rd.popFront(); auto t = rd.front.to!real; if (b == 0) { writefln("%.10f", t ^^ (1.0L/a)); continue; } else if (a == 0) { writefln("%.10f", E ^^ (t ^^ (1.0L/b))); continue; } auto r = a / b * t ^^ (1.0L / b); auto eps = 1.0e-10L, x1 = 100.0L; for (;;) { auto lx = log(x1); auto x2 = x1 - (x1 * lx - r) / (lx + 1); if ((x2 - x1).abs < eps) break; x1 = x2; } writefln("%.10f", x1 ^^ (b/a)); } }