結果

問題 No.454 逆2乗和
ユーザー nebukuro09nebukuro09
提出日時 2016-12-05 00:54:52
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 2,825 ms
コンパイル使用メモリ 158,588 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 05:21:23
合計ジャッジ時間 5,358 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
import std.random;
import std.math;
import std.container;
import std.numeric;
import std.bigint;


void main() {
  auto x = readln.chomp.to!real;
  real ans = 0;
  foreach (i; 1..3000000) {
    ans += 1.0L / (x + i)^^2;
  }
  ans += 1 / (x+3000000+0.5);
  writefln("%.10f", ans);
}
0