結果

問題 No.278 連続する整数の和(2)
ユーザー fiordfiord
提出日時 2017-08-24 14:53:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 1,062 ms
コンパイル使用メモリ 86,708 KB
実行使用メモリ 76,348 KB
最終ジャッジ日時 2023-08-24 22:49:59
合計ジャッジ時間 2,658 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,076 KB
testcase_01 AC 72 ms
71,156 KB
testcase_02 AC 97 ms
76,348 KB
testcase_03 AC 72 ms
71,100 KB
testcase_04 AC 74 ms
71,104 KB
testcase_05 AC 77 ms
76,032 KB
testcase_06 AC 73 ms
70,908 KB
testcase_07 AC 71 ms
71,180 KB
testcase_08 AC 72 ms
71,292 KB
testcase_09 AC 72 ms
71,108 KB
testcase_10 AC 76 ms
76,028 KB
testcase_11 AC 89 ms
76,012 KB
testcase_12 AC 72 ms
71,252 KB
testcase_13 AC 88 ms
75,732 KB
testcase_14 AC 83 ms
75,852 KB
testcase_15 AC 116 ms
75,956 KB
testcase_16 AC 86 ms
75,976 KB
testcase_17 AC 84 ms
75,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = n if n % 2 == 1 else int(n / 2)
ret = i = 1
while i * i <= m:
    i += 1
    cnt = 1
    while m % i == 0:
        m /= i
        cnt += 1
    ret *= (i**cnt - 1) / (i - 1)
ret *= m + 1 if m > 1 else 1
print(int(ret))
0