結果

問題 No.278 連続する整数の和(2)
ユーザー fiord
提出日時 2017-08-24 14:53:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 75,264 KB
最終ジャッジ日時 2024-12-23 09:14:04
合計ジャッジ時間 2,070 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

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