結果

問題 No.454 逆2乗和
ユーザー fine
提出日時 2016-12-05 23:45:17
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 186 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2024-11-27 21:50:13
合計ジャッジ時間 66,285 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'bigdecimal'
x = BigDecimal(gets.chomp)
ans = BigDecimal("0.0")
1.upto(500000){|i|
    tmp = BigDecimal(i.to_s) + x
    ans += BigDecimal("1.0") / (tmp * tmp)
    }
puts ans.to_f
0