結果

問題 No.278 連続する整数の和(2)
ユーザー Nagisa
提出日時 2015-09-05 16:29:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,010 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-23 09:04:38
合計ジャッジ時間 8,544 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N % 2 == 0:
    N /= 2

n = 2
l = 1
s = 1
p = 1
import math
m = math.floor(math.sqrt(N))

while n in range(2, m):
    while N % n == 0:
        s += n**p
        p += 1
        N /= n
    else:
        l *= s
        s = 1
        p = 1
        n += 1

if N != 1:
    if l == 1:
        l = N+1
    else:
        l *= N+1

print(int(l))
0