結果

問題 No.888 約数の総和
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2019-10-22 10:30:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 158 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 11,444 KB
実行使用メモリ 46,632 KB
最終ジャッジ日時 2023-09-15 15:20:50
合計ジャッジ時間 7,980 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,248 KB
testcase_01 AC 77 ms
15,032 KB
testcase_02 AC 77 ms
15,096 KB
testcase_03 WA -
testcase_04 AC 77 ms
15,132 KB
testcase_05 AC 78 ms
15,100 KB
testcase_06 AC 79 ms
15,172 KB
testcase_07 AC 78 ms
15,356 KB
testcase_08 AC 78 ms
15,048 KB
testcase_09 AC 78 ms
15,268 KB
testcase_10 AC 80 ms
15,120 KB
testcase_11 AC 78 ms
15,132 KB
testcase_12 AC 77 ms
15,060 KB
testcase_13 AC 77 ms
15,116 KB
testcase_14 AC 76 ms
15,280 KB
testcase_15 AC 77 ms
15,140 KB
testcase_16 AC 76 ms
15,264 KB
testcase_17 AC 77 ms
15,104 KB
testcase_18 AC 340 ms
46,580 KB
testcase_19 AC 276 ms
38,708 KB
testcase_20 AC 211 ms
31,764 KB
testcase_21 AC 327 ms
45,644 KB
testcase_22 AC 328 ms
46,484 KB
testcase_23 AC 87 ms
16,284 KB
testcase_24 AC 183 ms
27,608 KB
testcase_25 AC 206 ms
30,872 KB
testcase_26 AC 209 ms
31,476 KB
testcase_27 AC 279 ms
38,724 KB
testcase_28 AC 278 ms
39,860 KB
testcase_29 AC 283 ms
40,356 KB
testcase_30 AC 290 ms
41,248 KB
testcase_31 AC 311 ms
43,964 KB
testcase_32 AC 330 ms
46,632 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
].inject(:+)
0