結果
問題 |
No.456 Millions of Submits!
|
ユーザー |
![]() |
提出日時 | 2017-08-20 18:58:07 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 830 ms / 4,500 ms |
コード長 | 1,133 bytes |
コンパイル時間 | 3,324 ms |
コンパイル使用メモリ | 66,972 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 02:58:56 |
合計ジャッジ時間 | 11,122 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils,strutils,math,strscans 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: s = stdin.readline discard scanf(s,"$f $f $f", a, b, 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)