結果

問題 No.278 連続する整数の和(2)
ユーザー convexineqconvexineq
提出日時 2020-12-26 17:32:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,628 KB
実行使用メモリ 59,516 KB
最終ジャッジ日時 2023-10-25 01:06:25
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,384 KB
testcase_01 AC 37 ms
53,384 KB
testcase_02 AC 55 ms
57,148 KB
testcase_03 AC 37 ms
53,384 KB
testcase_04 AC 37 ms
53,384 KB
testcase_05 AC 40 ms
57,148 KB
testcase_06 AC 41 ms
57,148 KB
testcase_07 AC 42 ms
59,516 KB
testcase_08 AC 54 ms
57,148 KB
testcase_09 AC 55 ms
57,148 KB
testcase_10 AC 58 ms
57,148 KB
testcase_11 AC 54 ms
57,148 KB
testcase_12 AC 37 ms
53,384 KB
testcase_13 AC 52 ms
57,148 KB
testcase_14 AC 49 ms
57,148 KB
testcase_15 AC 50 ms
57,148 KB
testcase_16 AC 48 ms
57,148 KB
testcase_17 AC 55 ms
57,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor_list(N): #約数のリスト
    if N == 1: return [1]
    res = []
    for i in range(1,N):
        if i*i >= N: break
        if N%i == 0:
            res.append(i)
            res.append(N//i)
    if i*i == N: res.append(i)
    return sorted(res)

n = int(input())
print(sum(divisor_list(n if n%2 else n//2)))
0