結果

問題 No.1271 初めての級数
ユーザー KisaragiEffectiveKisaragiEffective
提出日時 2021-05-17 01:06:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,466 ms / 2,000 ms
コード長 131 bytes
コンパイル時間 32 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 46,024 KB
最終ジャッジ日時 2024-04-15 15:07:41
合計ジャッジ時間 9,899 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,466 ms
46,024 KB
testcase_01 AC 177 ms
20,864 KB
testcase_02 AC 189 ms
20,864 KB
testcase_03 AC 803 ms
24,448 KB
testcase_04 AC 815 ms
24,576 KB
testcase_05 AC 251 ms
20,992 KB
testcase_06 AC 337 ms
20,864 KB
testcase_07 AC 671 ms
22,784 KB
testcase_08 AC 787 ms
23,936 KB
testcase_09 AC 732 ms
24,064 KB
testcase_10 AC 409 ms
20,864 KB
testcase_11 AC 694 ms
23,552 KB
testcase_12 AC 437 ms
20,864 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

k = gets.to_i
r = k == 0 ? 20000 : 100000;
puts (1..r).map { Rational(1, _1 * (_1 + k)) }.inject(:+).to_f + (10 ** -Math::log10(r))
0