結果

問題 No.456 Millions of Submits!
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-12-31 23:12:39
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 2,083 ms
コンパイル使用メモリ 156,144 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-03 00:21:05
合計ジャッジ時間 13,553 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import std.conv;
import std.math;
import std.numeric;
import std.stdio;
import std.string;


real solveEquation(int a, int b, real t) {
	//auto g = (T n) => a * n.log + b * n.log.log - t.log;
	auto g = (real n) => pow(n, a) * pow(n.log, b) - t;
	real root;
	if (b > 0) {
		root = findRoot(g, 1.0L, real.max);
	} else {
		root = findRoot(g, 0.0L, real.max);
	}
	return root;
}


void main(){
	auto m = readln.chomp.to!int;
	foreach (i; 0..m) {
		auto s = readln.split;
		auto a = s[0].to!int;
		auto b = s[1].to!int;
		auto t = s[2].to!real;
		auto res = solveEquation(a, b, t);
		writefln("%.10f\n", res);
	}
}
0