結果
| 問題 | No.888 約数の総和 |
| コンテスト | |
| ユーザー |
wonda_t_coffee
|
| 提出日時 | 2020-02-04 23:37:44 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 121 ms / 2,000 ms |
| コード長 | 181 bytes |
| 記録 | |
| コンパイル時間 | 42 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 23,040 KB |
| 最終ジャッジ日時 | 2026-04-09 14:46:37 |
| 合計ジャッジ時間 | 3,776 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.chomp.to_i
ans = 0
lim = n**0.5
# puts "lim = #{lim}"
(1..lim.to_i).to_a.each do |d|
next if n % d > 0
ans += d + n / d
end
ans -= lim.to_i if lim == lim.to_i
puts ans
wonda_t_coffee