結果

問題 No.456 Millions of Submits!
ユーザー t8m8⛄️t8m8⛄️
提出日時 2016-12-08 20:44:22
言語 Nim
(2.0.2)
結果
TLE  
実行時間 -
コード長 859 bytes
コンパイル時間 4,683 ms
コンパイル使用メモリ 64,512 KB
実行使用メモリ 17,176 KB
最終ジャッジ日時 2023-09-12 08:50:37
合計ジャッジ時間 16,925 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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]
/home/judge/data/code/Main.nim(1, 34) Warning: imported and not used: 'strscans' [UnusedImport]

ソースコード

diff #

import strutils, sequtils, math, strscans

{.checks: off, optimization: speed.}

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)

type
  Array = array[0..11*11*10001, float64]

when isMainModule:
  var
    m, a, b: int
    t: float64
  scanf("%ld", addr m)

  var x : Array

  for i in 0..10:
    for j in 0..10:
      for k in 0..10000:
        var (l, r) = (0.0, 1000000000.0)

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

        x[i+11*j+11*11*k] = r

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