結果
| 問題 |
No.456 Millions of Submits!
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2017-05-16 18:03:01 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 4,020 ms / 4,500 ms |
| コード長 | 1,493 bytes |
| コンパイル時間 | 980 ms |
| コンパイル使用メモリ | 110,368 KB |
| 実行使用メモリ | 31,352 KB |
| 最終ジャッジ日時 | 2024-06-23 18:46:56 |
| 合計ジャッジ時間 | 12,724 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
class Program
{
static StreamWriter sw;
static void Main()
{
sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
Console.SetOut(sw);
Solve();
Console.Out.Flush();
}
static void Solve()
{
int m = int.Parse(Console.ReadLine());
for (int i = 0; i < m; i++)
{
var tmp = Console.ReadLine().Split();
double a = double.Parse(tmp[0]);
double b = double.Parse(tmp[1]);
double t = double.Parse(tmp[2]);
double n;
if (a == 0.0) n = Exp(Pow(t, 1.0 / b));
else if (b == 0.0) n = Pow(t, 1.0 / a);
else
{
double d; n = 2.0;
do
{
double t1 = Log(n);
double t2 = Pow(n, a - 2.0);
double t3 = Pow(t1, b - 2.0);
double d0 = t2 * n * n * t3 * t1 * t1 - t;
double d1 = t2 * n * t3 * t1 * (a * t1 + b);
double d2 = t2 * t3 * (((a * 2.0 - 1.0) * b + (a - 1.0) * a * t1) * t1 + (b - 1.0) * b);
d = d0 / (d1 - (d0 * d2) / (d1 * 2.0));
n -= d;
}
while (Abs(d) > 10e-10);
}
Console.WriteLine("{0:.#########}", n);
}
}
}
くれちー