結果

問題 No.456 Millions of Submits!
ユーザー 6soukiti296soukiti29
提出日時 2017-08-20 06:56:02
言語 Nim
(2.0.2)
結果
AC  
実行時間 1,119 ms / 4,500 ms
コード長 1,178 bytes
コンパイル時間 2,900 ms
コンパイル使用メモリ 67,836 KB
実行使用メモリ 4,440 KB
最終ジャッジ日時 2023-09-12 14:56:42
合計ジャッジ時間 11,931 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
4,396 KB
testcase_01 AC 23 ms
4,384 KB
testcase_02 AC 24 ms
4,380 KB
testcase_03 AC 24 ms
4,440 KB
testcase_04 AC 24 ms
4,380 KB
testcase_05 AC 25 ms
4,384 KB
testcase_06 AC 25 ms
4,376 KB
testcase_07 AC 26 ms
4,380 KB
testcase_08 AC 26 ms
4,396 KB
testcase_09 AC 36 ms
4,376 KB
testcase_10 AC 35 ms
4,376 KB
testcase_11 AC 134 ms
4,380 KB
testcase_12 AC 1,119 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,math

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

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:
    scanf("%lf %lf %lf",addr a,addr b,addr t)
    (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)
        for l in 0..1:
            slope = ln(n) + 1
            n = n - (p - q) / slope
            p = n * ln(n)
        n = pow(n, b / a)
    printf("%.11f\n",n)
0