結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-12-31 23:12:39 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 610 bytes |
| 記録 | |
| コンパイル時間 | 2,963 ms |
| コンパイル使用メモリ | 156,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-12 06:13:03 |
| 合計ジャッジ時間 | 12,941 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 12 TLE * 1 |
ソースコード
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);
}
}
はむ吉🐹