結果

問題 No.456 Millions of Submits!
ユーザー むらためむらため
提出日時 2017-08-18 06:51:36
言語 Nim
(2.0.0)
結果
WA  
実行時間 -
コード長 1,271 bytes
コンパイル時間 5,494 ms
コンパイル使用メモリ 75,292 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-12 14:50:20
合計ジャッジ時間 7,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

import sequtils,strutils,osproc;const p = @[ """echo '{.experimental.}

import threadpool
import sequtils,strutils,algorithm,math,future,macros
template get*():string = stdin.readLine().strip()
macro unpack*(arr: auto,cnt: static[int]): auto =
  let t = genSym(); result = quote do:(let `t` = `arr`;())
  for i in 0..<cnt: result[0][1].add(quote do:`t`[`i`])
template times*(n:int,body) = (for _ in 0..<n: body)

# t , n^a (log n)^b 秒
# 53_300k_1.txt -> 1600 ms
let
  M = get().parseInt()
  ABT = newSeqWith(M,get().split().map(parseFloat))
proc solve(m:int): float =
  let (a,b,t) = ABT[m].unpack(3)
  proc newton(): float =
    result = 1.1
    var lnx = ln(result)
    for i in 1..25:
      result -= (a*lnx + b*lnx.ln - t.ln) / ((a*lnx + b) / (result*lnx))
      lnx = result.ln
  return if a == 0: exp(pow(t, 1.0/b))
          elif b == 0: pow(t, 1.0/a)
          else: newton()
proc main() =
  var ans = newSeq[float](M)
  parallel:
    for m in 0..ans.high:
      ans[m] = spawn solve(m)
  for m in 0..<M:
    echo(($ans[m])[0..11])
main()



' > h.nim""","nim --hints:off -o:b.out -d:release --threads:on --experimental --parallelBuild:4 c h.nim"].mapIt(it.gorge)
discard execProcess("""a="$(ls -1t ../time/ | head -1)";./b.out < ../test_in/$a > ../out/$a""")
0