結果

問題 No.456 Millions of Submits!
ユーザー t8m8⛄️
提出日時 2016-12-08 19:25:20
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 828 bytes
コンパイル時間 2,633 ms
コンパイル使用メモリ 67,552 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-29 21:34:23
合計ジャッジ時間 13,291 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'strutils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 34) Warning: imported and not used: 'strscans' [UnusedImport]

ソースコード

diff #

import strutils, sequtils, math, strscans

proc scanf(frmt: cstring) {.varargs, importc, header: "<stdio.h>".}
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
    a, b, t: float64
  scanf("%ld", addr m)

  var x = newSeqWith(11, newSeqWith(11, newSeq[float64](1001)))
  var max = 0.0
  for i in 0..10:
    for j in 0..10:
      for k in 0..1000:
        var (l, r) = (0.0, 10000000.0)

        for p in 1..64:
          var mid = (l + r) / 2
          if f(mid, i.float64, j.float64) <= k.float64 / 100: l = mid
          else: r = mid

        x[i][j][k] = r

  for i in 0..m-1:
    scanf("%lf %lf %lf", addr a, addr b, addr t)
    printf("%.11f\n", x[a.int][b.int][(t*100).int])
0