結果

問題 No.888 約数の総和
ユーザー MaboyMaboy
提出日時 2021-06-27 17:08:21
言語 Swift
(5.10.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 3,910 ms
コンパイル使用メモリ 175,796 KB
実行使用メモリ 13,552 KB
最終ジャッジ日時 2023-09-07 18:05:33
合計ジャッジ時間 5,998 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
13,360 KB
testcase_01 AC 6 ms
13,068 KB
testcase_02 AC 6 ms
13,140 KB
testcase_03 AC 6 ms
13,268 KB
testcase_04 AC 6 ms
13,168 KB
testcase_05 AC 6 ms
13,132 KB
testcase_06 AC 5 ms
13,080 KB
testcase_07 AC 6 ms
13,244 KB
testcase_08 AC 6 ms
13,136 KB
testcase_09 AC 5 ms
13,364 KB
testcase_10 AC 6 ms
13,548 KB
testcase_11 AC 6 ms
13,320 KB
testcase_12 AC 5 ms
13,140 KB
testcase_13 AC 5 ms
13,060 KB
testcase_14 AC 6 ms
13,300 KB
testcase_15 AC 6 ms
13,012 KB
testcase_16 AC 6 ms
13,364 KB
testcase_17 AC 6 ms
13,080 KB
testcase_18 AC 18 ms
13,028 KB
testcase_19 AC 14 ms
13,100 KB
testcase_20 AC 12 ms
13,364 KB
testcase_21 AC 18 ms
13,176 KB
testcase_22 AC 18 ms
13,252 KB
testcase_23 AC 6 ms
13,160 KB
testcase_24 AC 11 ms
13,096 KB
testcase_25 AC 12 ms
13,552 KB
testcase_26 AC 11 ms
13,364 KB
testcase_27 AC 14 ms
13,080 KB
testcase_28 AC 15 ms
13,324 KB
testcase_29 AC 15 ms
13,080 KB
testcase_30 AC 15 ms
13,384 KB
testcase_31 AC 17 ms
13,332 KB
testcase_32 AC 18 ms
13,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import Foundation
let n = Int(readLine()!)!
var l = [Int]()
for i in 1...Int(pow(Double(n),0.5)){
    if n % i == 0{
        l += [i,n/i]
    }
}
print(Array(Set(l)).reduce(0){$0 + $1})
0