結果
| 問題 |
No.456 Millions of Submits!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-02 14:09:40 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 4,018 ms / 4,500 ms |
| コード長 | 2,655 bytes |
| コンパイル時間 | 2,672 ms |
| コンパイル使用メモリ | 78,384 KB |
| 実行使用メモリ | 64,424 KB |
| 最終ジャッジ日時 | 2024-12-29 06:20:15 |
| 合計ジャッジ時間 | 17,760 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Chiaki.Hoshinomori
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Task456 solver = new Task456();
int testCount = Integer.parseInt(in.next());
for (int i = 1; i <= testCount; i++)
solver.solve(i, in, out);
out.close();
}
static class Task456 {
static double e = Math.exp(1);
public void solve(int testNumber, InputReader in, PrintWriter out) {
int a = in.nextInt();
int b = in.nextInt();
double t = in.nextDouble();
if (b == 0) {
out.printf("%.12f\n", Math.pow(t, 1.0 / a));
return;
}
if (a == 0) {
out.printf("%.12f\n", Math.exp(Math.pow(t, 1.0 / b)));
return;
}
double q = Math.pow(t, 1.0 / b) * a / b;
double l = Math.min(e, q);
double r = Math.max(e, q);
for (int it = 0; it < 40; ++it) {
double m = (l + r) / 2;
if (m * Math.log(m) > q) {
r = m;
} else {
l = m;
}
}
out.printf("%.12f\n", Math.pow(r, 1.0 * b / a));
}
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
}