結果

問題 No.278 連続する整数の和(2)
ユーザー NagisaNagisa
提出日時 2015-09-05 16:29:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 972 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 8,216 KB
最終ジャッジ日時 2023-08-24 22:41:13
合計ジャッジ時間 8,107 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,068 KB
testcase_01 AC 16 ms
8,112 KB
testcase_02 AC 761 ms
8,092 KB
testcase_03 AC 15 ms
8,068 KB
testcase_04 AC 15 ms
8,092 KB
testcase_05 AC 29 ms
8,216 KB
testcase_06 AC 39 ms
8,108 KB
testcase_07 AC 39 ms
8,060 KB
testcase_08 AC 740 ms
8,016 KB
testcase_09 AC 759 ms
8,184 KB
testcase_10 AC 972 ms
8,064 KB
testcase_11 AC 747 ms
8,120 KB
testcase_12 AC 17 ms
8,128 KB
testcase_13 AC 648 ms
8,156 KB
testcase_14 AC 481 ms
8,120 KB
testcase_15 AC 556 ms
8,012 KB
testcase_16 AC 427 ms
8,192 KB
testcase_17 AC 775 ms
8,192 KB
権限があれば一括ダウンロードができます

ソースコード

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