結果

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

ソースコード

diff #

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