結果

問題 No.278 連続する整数の和(2)
ユーザー convexineqconvexineq
提出日時 2020-12-26 17:32:12
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 258 ms
使用メモリ 80,288 KB
最終ジャッジ日時 2022-11-23 16:09:52
合計ジャッジ時間 3,348 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 79 ms
75,488 KB
testcase_01 AC 79 ms
75,716 KB
testcase_02 AC 98 ms
79,932 KB
testcase_03 AC 80 ms
75,588 KB
testcase_04 AC 79 ms
75,688 KB
testcase_05 AC 83 ms
80,164 KB
testcase_06 AC 82 ms
79,996 KB
testcase_07 AC 82 ms
80,280 KB
testcase_08 AC 94 ms
80,088 KB
testcase_09 AC 93 ms
79,856 KB
testcase_10 AC 99 ms
80,032 KB
testcase_11 AC 96 ms
79,860 KB
testcase_12 AC 79 ms
75,832 KB
testcase_13 AC 92 ms
80,288 KB
testcase_14 AC 88 ms
80,000 KB
testcase_15 AC 91 ms
79,892 KB
testcase_16 AC 92 ms
79,900 KB
testcase_17 AC 99 ms
79,860 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