問題一覧 > 通常問題

No.454 Sum of Inverse Squares

レベル : / AI推定難易度 : 900 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-9}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 98
作問者 : koba-e964 / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 1436 / 自分の提出
問題文最終更新日: 2026-06-25 13:05:49
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2016 (順位表) の他の問題:
This problem is the Day 5 problem of Advent Calendar Contest 2016.

Problem Statement

There is a famous formula $\sum_{n=1}^{\infty} 1 / n^2 = \pi^2/6$. Now, given a non-negative real number $x$, compute the limit of the series $\sum_{n=1}^{\infty} 1 / (x+n)^2$.
An absolute or relative error of up to $10^{-9}$ is allowed.

Input

$x$

$0 \le x \le 1000$

Output

Output the limit of the series in question on one line. Print a newline at the end.

Sample

Sample 1
Input
0
Output
1.6449340668482426

$\pi^2/6 = 1.6449340668482264\cdots$. An error of $10^{-9}$ or less is allowed.

Sample 2
Input
1.5
Output
0.490357756100235

Sample 3
Input
1000
Output
0.0009995001666667166

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。