結果

問題 No.278 連続する整数の和(2)
ユーザー roiti46roiti46
提出日時 2015-09-04 23:19:27
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 6,596 KB
実行使用メモリ 6,124 KB
最終ジャッジ日時 2023-09-26 06:41:42
合計ジャッジ時間 1,917 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,916 KB
testcase_01 AC 11 ms
5,900 KB
testcase_02 AC 268 ms
5,900 KB
testcase_03 AC 11 ms
6,080 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 11 ms
5,828 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 11 ms
5,916 KB
testcase_10 AC 14 ms
5,932 KB
testcase_11 WA -
testcase_12 AC 11 ms
5,852 KB
testcase_13 WA -
testcase_14 AC 28 ms
5,916 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 28 ms
5,988 KB
権限があれば一括ダウンロードができます

ソースコード

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) / (i - 1)
    i += 1
if n > 1:
    ans *= 1 + n

print ans
0