結果
| 問題 |
No.456 Millions of Submits!
|
| コンテスト | |
| ユーザー |
t8m8⛄️
|
| 提出日時 | 2016-12-08 20:22:28 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 734 bytes |
| コンパイル時間 | 2,874 ms |
| コンパイル使用メモリ | 67,064 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 21:32:59 |
| 合計ジャッジ時間 | 6,316 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 6 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'strutils' [UnusedImport] /home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import strutils, sequtils, math, strscans
proc printf(formatstr: cstring) {.header: "<stdio.h>", importc: "printf", varargs.}
proc f(n, a, b : float64): float64 {.inline.} = pow(n, a) * pow(ln(n), b)
when isMainModule:
var
m: int
input = stdin.readLine
a, b, t, l, r: float64
discard input.scanf("$i", m)
var memo = newSeq[float64](100001)
for i in 0..m-1:
(l, r) = (0.0, 1000000000.0)
input = stdin.readLine
discard input.scanf("$f $f $f", a, b, t)
var x = (t*10000).int
if memo[x] != 0:
printf("%.11f\n", memo[x])
else:
for i in 1..64:
var mid = (l + r) / 2
if f(mid, a, b) <= t: l = mid
else: r = mid
memo[x] = r
printf("%.11f\n", r)
t8m8⛄️