結果

問題 No.888 約数の総和
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2019-10-22 10:31:37
言語 Ruby
(3.2.2)
結果
AC  
実行時間 374 ms / 2,000 ms
コード長 163 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 54,940 KB
最終ジャッジ日時 2023-09-15 15:21:26
合計ジャッジ時間 7,956 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,160 KB
testcase_01 AC 77 ms
15,324 KB
testcase_02 AC 77 ms
15,180 KB
testcase_03 AC 77 ms
15,228 KB
testcase_04 AC 78 ms
15,244 KB
testcase_05 AC 77 ms
15,036 KB
testcase_06 AC 79 ms
15,140 KB
testcase_07 AC 78 ms
15,088 KB
testcase_08 AC 78 ms
15,068 KB
testcase_09 AC 78 ms
15,072 KB
testcase_10 AC 79 ms
15,032 KB
testcase_11 AC 78 ms
15,128 KB
testcase_12 AC 78 ms
15,248 KB
testcase_13 AC 79 ms
15,160 KB
testcase_14 AC 78 ms
15,344 KB
testcase_15 AC 79 ms
15,012 KB
testcase_16 AC 79 ms
15,008 KB
testcase_17 AC 78 ms
15,016 KB
testcase_18 AC 374 ms
54,940 KB
testcase_19 AC 302 ms
46,944 KB
testcase_20 AC 237 ms
35,860 KB
testcase_21 AC 364 ms
53,764 KB
testcase_22 AC 371 ms
54,592 KB
testcase_23 AC 90 ms
16,724 KB
testcase_24 AC 194 ms
31,828 KB
testcase_25 AC 223 ms
34,964 KB
testcase_26 AC 231 ms
35,360 KB
testcase_27 AC 306 ms
47,072 KB
testcase_28 AC 315 ms
47,888 KB
testcase_29 AC 317 ms
48,536 KB
testcase_30 AC 326 ms
49,348 KB
testcase_31 AC 367 ms
52,048 KB
testcase_32 AC 371 ms
54,604 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
puts [
  1,
  *2.upto(Math.sqrt(N).floor).map { |n|
    next 0 unless (N % n).zero?
    n**2 == N ? n : [n, N / n]
  }.flatten,
  N
].uniq.inject(:+)
0