結果
問題 | No.454 逆2乗和 |
ユーザー |
|
提出日時 | 2016-12-05 02:40:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 37 ms / 2,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 244 ms |
コンパイル使用メモリ | 38,016 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 02:42:22 |
合計ジャッジ時間 | 2,506 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
#include <cstdio>#include <cmath>#define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i))int main() {long double x; scanf("%Lf", &x);long double y = 0;const int l = 1000000;repeat_from (n,1,l) y += powl(x+n, -2);y += 1.0/(x+l);printf("%.18Lf\n", y);return 0;}