結果

問題 No.456 Millions of Submits!
ユーザー 6soukiti296soukiti29
提出日時 2017-07-19 23:39:06
言語 Nim
(2.0.0)
結果
TLE  
実行時間 -
コード長 1,365 bytes
コンパイル時間 3,232 ms
コンパイル使用メモリ 72,576 KB
実行使用メモリ 19,588 KB
最終ジャッジ日時 2023-09-12 13:27:26
合計ジャッジ時間 12,468 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 10 ms
4,376 KB
testcase_08 AC 9 ms
4,380 KB
testcase_09 AC 70 ms
4,380 KB
testcase_10 AC 69 ms
4,380 KB
testcase_11 AC 690 ms
7,124 KB
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils,strutils,math
type
    kakaku = tuple[t : float64, n : float64]
var
    k = stdin.readline.parseInt
    a,b,t,n : float64
    ai,bi : int
    M,m : float64
    M2,m2,n2,index : int
    s : string
    kTable = newSeqWith(11,newSeqWith(11,newSeq[kakaku](0)))
for i in 1..k:
    (a,b,t) = stdin.readline.split.map(parseFloat)
    (ai,bi) = (a.int,b.int)
    n = 1.0
    m = 0.0
    M = 1.0
    if kTable[ai][bi].len == 0 or t > kTable[ai][bi][^1].t:
        index = kTable[ai][bi].len
        while true:
            if pow(n,a) * pow(ln(n),b) <= t:
                m = n
                n *= 2.0
            else:
                break
        M = n
    else:
        if t < kTable[ai][bi][0].t:
            M = kTable[ai][bi][0].n
            m = 0.0
            index = 0
        else:
            M2 = kTable[ai][bi].len
            m2 = 0
            while M2 - m2 > 1:
                n2 = (M2 + m2) div 2
                if kTable[ai][bi][n2].t < t:
                    m2 = n2
                else:
                    M2 = n2
            M = kTable[ai][bi][M2].n
            m = kTable[ai][bi][m2].n
            index = M2
    while M - m > 0.000_000_000_5:
        n = (M + m) / 2.0
        if pow(n,a) * pow(ln(n),b) <= t:
            m = n
        else:
            M = n
    kTable[ai][bi].insert((t, M),index)
    s = $M
    echo s[0..11]
0