結果

問題 No.278 連続する整数の和(2)
ユーザー char134217728char134217728
提出日時 2017-09-08 07:45:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 158 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 11,200 KB
実行使用メモリ 15,592 KB
最終ジャッジ日時 2023-08-24 22:50:26
合計ジャッジ時間 2,888 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
15,208 KB
testcase_01 AC 91 ms
15,220 KB
testcase_02 AC 199 ms
15,284 KB
testcase_03 AC 89 ms
15,420 KB
testcase_04 AC 89 ms
15,468 KB
testcase_05 AC 90 ms
15,404 KB
testcase_06 AC 89 ms
15,380 KB
testcase_07 AC 89 ms
15,404 KB
testcase_08 AC 89 ms
15,328 KB
testcase_09 AC 88 ms
15,076 KB
testcase_10 AC 90 ms
15,212 KB
testcase_11 AC 102 ms
15,500 KB
testcase_12 AC 88 ms
15,212 KB
testcase_13 AC 163 ms
15,388 KB
testcase_14 AC 96 ms
15,576 KB
testcase_15 AC 130 ms
15,592 KB
testcase_16 AC 100 ms
15,284 KB
testcase_17 AC 96 ms
15,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
n = gets.to_i
n = n.gcd(n * (n + 1) / 2)
p n.prime_division.inject(1){|a, b|
  t = 0
  (0..b[1]).each do |i|
    t += b[0]**i
  end
  a *= t
}
0