結果

問題 No.888 約数の総和
ユーザー fV9TwBhUoa9S3eVfV9TwBhUoa9S3eV
提出日時 2019-10-30 15:13:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 8,432 KB
最終ジャッジ日時 2023-10-12 23:48:31
合計ジャッジ時間 3,541 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,856 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 17 ms
7,824 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,772 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 16 ms
7,956 KB
testcase_10 WA -
testcase_11 AC 16 ms
7,868 KB
testcase_12 AC 15 ms
7,772 KB
testcase_13 AC 15 ms
7,840 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 15 ms
7,772 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 118 ms
7,784 KB
testcase_20 WA -
testcase_21 AC 153 ms
8,432 KB
testcase_22 AC 150 ms
7,772 KB
testcase_23 WA -
testcase_24 AC 71 ms
7,784 KB
testcase_25 WA -
testcase_26 AC 86 ms
7,776 KB
testcase_27 AC 120 ms
7,932 KB
testcase_28 AC 123 ms
7,912 KB
testcase_29 WA -
testcase_30 AC 130 ms
7,968 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# No.888 約数の総和
n = int(input())
divisors = []

if n == 1:
    divisors = [1]
elif n < 4:
    divisors = [1, n]
else:
    divisors = [1, n]
    for i in range(2, int(n ** 0.5) + 2):
        if n % i == 0:
            divisors.append(i)
            divisors.append(n // i)

print(sum(divisors))
0