結果

問題 No.888 約数の総和
ユーザー kbyskbys
提出日時 2020-03-29 03:06:51
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
RE  
実行時間 -
コード長 483 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 10,992 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2023-08-30 18:33:19
合計ジャッジ時間 2,538 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,764 KB
testcase_01 AC 15 ms
7,908 KB
testcase_02 AC 15 ms
7,872 KB
testcase_03 RE -
testcase_04 AC 15 ms
7,900 KB
testcase_05 AC 15 ms
7,756 KB
testcase_06 AC 15 ms
7,848 KB
testcase_07 AC 15 ms
7,816 KB
testcase_08 AC 15 ms
7,848 KB
testcase_09 AC 15 ms
7,804 KB
testcase_10 AC 15 ms
7,832 KB
testcase_11 AC 15 ms
7,840 KB
testcase_12 AC 15 ms
7,972 KB
testcase_13 AC 15 ms
7,760 KB
testcase_14 AC 15 ms
7,816 KB
testcase_15 AC 15 ms
7,844 KB
testcase_16 AC 15 ms
7,844 KB
testcase_17 AC 15 ms
7,820 KB
testcase_18 AC 67 ms
7,796 KB
testcase_19 AC 54 ms
7,884 KB
testcase_20 AC 43 ms
7,848 KB
testcase_21 AC 65 ms
7,780 KB
testcase_22 AC 75 ms
7,976 KB
testcase_23 AC 18 ms
7,780 KB
testcase_24 AC 38 ms
7,788 KB
testcase_25 AC 41 ms
7,764 KB
testcase_26 AC 47 ms
7,900 KB
testcase_27 AC 75 ms
7,848 KB
testcase_28 AC 78 ms
7,832 KB
testcase_29 AC 57 ms
7,772 KB
testcase_30 AC 83 ms
7,944 KB
testcase_31 AC 63 ms
7,780 KB
testcase_32 AC 67 ms
7,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

p = factorization(N)
#print(p)
ans = 1
for lst in p:
    ans *= int((lst[0]**(lst[1]+1)-1)/(lst[0]-1))
print(ans)
0