結果

問題 No.456 Millions of Submits!
コンテスト
ユーザー t8m8⛄️
提出日時 2016-12-08 17:27:17
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 3,184 ms / 4,500 ms
コード長 640 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,700 ms
コンパイル使用メモリ 69,860 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-19 12:08:18
合計ジャッジ時間 11,682 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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]

ソースコード

diff #
raw source code

import strutils, sequtils, math, strscans

proc printf(formatstr: cstring) {.header: "<stdio.h>", importc: "printf", varargs.}

proc f(n, a, b : float64): float64 = pow(n, a) * pow(ln(n), b)
# proc f(n, a, b : float64): float64 = a*log2(n) + b*log2(ln(n))

when isMainModule:
  var
    m: int
    input = stdin.readLine
  discard input.scanf("$i", m)
  for i in 0..m-1:
    var a, b, t: float64
    input = stdin.readLine
    discard input.scanf("$f $f $f", a, b, t)
    var
      (l, r) = (0.0, 1000000000.0)

    for i in 1..64:
      var mid = (l + r) / 2
      if f(mid, a, b) <= t: l = mid
      else: r = mid

    printf("%.11f\n", r)
0