結果

問題 No.454 逆2乗和
ユーザー むらため
提出日時 2019-01-30 07:10:53
言語 Nim
(2.2.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 3,104 ms
コンパイル使用メモリ 65,636 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 11:11:56
合計ジャッジ時間 4,205 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,math
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)

let x = stdin.readLine().parseFloat()
var ans = 0.0
for i in 1000000.countdown(1):
  let n = i.float
  ans += x * (x + 2.0 * n) / (n * n * (x + n) * (x + n))
echo PI * PI / 6 - ans
0