結果

問題 No.456 Millions of Submits!
ユーザー くれちーくれちー
提出日時 2017-05-16 17:55:55
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 2,253 bytes
コンパイル時間 2,784 ms
コンパイル使用メモリ 105,196 KB
実行使用メモリ 35,768 KB
最終ジャッジ日時 2023-09-05 23:29:00
合計ジャッジ時間 14,790 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
30,076 KB
testcase_01 AC 78 ms
23,572 KB
testcase_02 AC 77 ms
25,660 KB
testcase_03 AC 76 ms
23,640 KB
testcase_04 AC 77 ms
25,696 KB
testcase_05 AC 79 ms
23,644 KB
testcase_06 AC 80 ms
23,764 KB
testcase_07 AC 101 ms
23,544 KB
testcase_08 AC 101 ms
23,488 KB
testcase_09 AC 314 ms
31,760 KB
testcase_10 AC 311 ms
27,584 KB
testcase_11 AC 2,388 ms
29,616 KB
testcase_12 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using static Extensions;

static class Extensions
{
    public static void GetNums<T1>(out T1 dest1)
    {
        var str = Console.ReadLine().Split();
        dest1 = (T1)typeof(T1)
            .GetMethod("Parse", new Type[] { typeof(string) })
            .Invoke(null, new object[] { str[0] });
    }
    public static void GetNums<T1, T2, T3>(out T1 dest1, out T2 dest2, out T3 dest3)
    {
        var str = Console.ReadLine().Split();
        dest1 = (T1)typeof(T1)
            .GetMethod("Parse", new Type[] { typeof(string) })
            .Invoke(null, new object[] { str[0] });
        dest2 = (T2)typeof(T2)
            .GetMethod("Parse", new Type[] { typeof(string) })
            .Invoke(null, new object[] { str[1] });
        dest3 = (T3)typeof(T3)
            .GetMethod("Parse", new Type[] { typeof(string) })
            .Invoke(null, new object[] { str[2] });
    }
}

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;
        GetNums(out m);

        for (int i = 0; i < m; i++)
        {
            double a, b, t;
            GetNums(out a, out b, out t);
            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);
            }
            sw.WriteLine("{0:.#########}", n);
        }
    }
}
0