結果
| 問題 | No.456 Millions of Submits! |
| コンテスト | |
| ユーザー |
6soukiti29
|
| 提出日時 | 2017-08-20 06:56:02 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 850 ms / 4,500 ms |
| コード長 | 1,178 bytes |
| 記録 | |
| コンパイル時間 | 3,080 ms |
| コンパイル使用メモリ | 64,896 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 02:58:03 |
| 合計ジャッジ時間 | 10,311 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
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)
6soukiti29