結果

問題 No.278 連続する整数の和(2)
ユーザー roiti46roiti46
提出日時 2015-09-04 23:18:25
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 299 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 6,668 KB
実行使用メモリ 6,076 KB
最終ジャッジ日時 2023-09-26 06:41:14
合計ジャッジ時間 2,204 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,928 KB
testcase_01 AC 12 ms
5,780 KB
testcase_02 AC 267 ms
5,920 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 12 ms
6,076 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())

if N <= 2:
    print 1
    exit()
elif N == 3:
    print 4
    exit()

n = N
i = 2
ans = 1
while i*i <= n:
    p = 0
    while n % i == 0:
        n /= i
        p += 1
    if p > 0:
        ans *= (pow(i, p + 1) - 1) / (p - 1)
    i += 1
if n > 1:
    ans *= 1 + n

print ans
0