結果
| 問題 |
No.9000 Hello World! (テスト用)
|
| ユーザー |
|
| 提出日時 | 2017-08-18 03:23:21 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 348 bytes |
| コンパイル時間 | 3,843 ms |
| コンパイル使用メモリ | 87,552 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 02:47:57 |
| 合計ジャッジ時間 | 4,432 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 22) Warning: use the nimble packages `malebolgia`, `taskpools` or `weave` instead; threadpool is deprecated [Deprecated] /home/judge/data/code/Main.nim(3, 8) Warning: imported and not used: 'sequtils' [UnusedImport] /home/judge/data/code/Main.nim(3, 24) Warning: imported and not used: 'osproc' [UnusedImport] /home/judge/data/code/Main.nim(3, 17) Warning: imported and not used: 'macros' [UnusedImport]
ソースコード
{.experimental.}
import strutils,math,threadpool
import sequtils,macros,osproc
proc term(k: float): float = 4 * math.pow(-1, k) / (2*k + 1)
proc pi(n: int): float =
var ch = newSeq[float](n+1)
parallel:
for k in 0..ch.high:
ch[k] = spawn term(float(k))
for k in 0..ch.high:
result += ch[k]
let f = formatFloat(pi(5000))
echo f