結果

問題 No.278 連続する整数の和(2)
ユーザー ckawatakckawatak
提出日時 2018-03-14 10:04:48
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 8,044 KB
最終ジャッジ日時 2023-08-17 11:49:13
合計ジャッジ時間 3,310 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,940 KB
testcase_01 AC 16 ms
7,924 KB
testcase_02 AC 168 ms
7,868 KB
testcase_03 AC 16 ms
7,900 KB
testcase_04 AC 16 ms
7,984 KB
testcase_05 AC 20 ms
8,032 KB
testcase_06 AC 20 ms
7,980 KB
testcase_07 AC 22 ms
7,884 KB
testcase_08 AC 222 ms
7,912 KB
testcase_09 AC 160 ms
8,044 KB
testcase_10 AC 195 ms
7,880 KB
testcase_11 AC 215 ms
7,952 KB
testcase_12 AC 16 ms
7,916 KB
testcase_13 AC 184 ms
7,916 KB
testcase_14 AC 104 ms
7,912 KB
testcase_15 AC 163 ms
7,900 KB
testcase_16 AC 132 ms
7,868 KB
testcase_17 AC 159 ms
8,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor, sqrt

N = int(input())

if N % 2 ==0:
    N /= 2

a = 0
for i in range(1, floor(sqrt(N))+1):
    if N % i == 0:
        a += i
        if i * i != N:
            a += N/i
print(int(a))
0