結果

問題 No.1235 ζ関数
ユーザー neko_the_shadowneko_the_shadow
提出日時 2020-09-21 15:18:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 127 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 11,492 KB
実行使用メモリ 15,624 KB
最終ジャッジ日時 2023-09-06 17:16:58
合計ジャッジ時間 3,726 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,044 KB
testcase_01 AC 88 ms
15,416 KB
testcase_02 AC 86 ms
15,372 KB
testcase_03 AC 88 ms
15,432 KB
testcase_04 AC 85 ms
15,152 KB
testcase_05 AC 86 ms
15,272 KB
testcase_06 AC 87 ms
15,524 KB
testcase_07 AC 84 ms
15,624 KB
testcase_08 AC 87 ms
15,364 KB
testcase_09 AC 85 ms
15,508 KB
testcase_10 AC 85 ms
15,428 KB
testcase_11 AC 85 ms
15,548 KB
testcase_12 AC 86 ms
15,564 KB
testcase_13 AC 86 ms
15,336 KB
testcase_14 AC 86 ms
15,472 KB
testcase_15 AC 86 ms
15,604 KB
testcase_16 AC 85 ms
15,032 KB
testcase_17 AC 84 ms
15,592 KB
testcase_18 AC 84 ms
15,260 KB
testcase_19 AC 84 ms
15,536 KB
testcase_20 AC 85 ms
15,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i

a = [0]
(1..).each do |i|
  b = a[-1] + 1.0 / i**n
  if b == a[-1]
    p b
    break
  else
    a << b
  end
end
0