結果

問題 No.456 Millions of Submits!
ユーザー 6soukiti296soukiti29
提出日時 2017-07-26 10:57:46
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 1,082 bytes
コンパイル時間 4,131 ms
コンパイル使用メモリ 70,732 KB
実行使用メモリ 4,496 KB
最終ジャッジ日時 2023-09-12 13:34:32
合計ジャッジ時間 7,217 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

import sequtils,strutils,math


proc printf(formatstr: cstring)
    {.header: "<stdio.h>", varargs.}

var
    k = stdin.readline.parseInt
    a,b,t,n,p,q : float64
    ai,bi,ti : int
    slope : float64
    s : string
    kTable : array[100001,float64]
n = 30.0
t = 100.0
for i in 0..50:
    slope = ln(n)
    n = n - (p - t) / slope
    p = n * ln(n)
kTable[100000] = n
for i in 1..100000:
    t = (100000 - i).float64 / 1000
    n = kTable[100001 - i]
    p = (100001 - i).float64 / 1000
    for l in 0..3:
        slope = ln(n) + 1
        n -= (p - t) / slope
        p = n * ln(n)
    kTable[100000 - i] = n
for i in 1..k:
    (a,b,t) = stdin.readline.split.map(parseFloat)
    (ai,bi) = (a.int,b.int)
    if b == 0:
        n = pow(t, 1 / a)
    elif a == 0:
        n = exp(pow(t, 1 / b))
    else:
        ti = ceil(a / b * pow(t , 1 / b) * 1000) .int
        p = ti.float64 / 1000
        n = kTable[ti]
        q = a / b * pow(t , 1 / b)
        slope = ln(n) + 1
        n = n - (p - q) / slope
        p = n * ln(n)
        n = pow(n, b / a)
    printf("%.11f\n",n)
    
0