結果

問題 No.278 連続する整数の和(2)
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-09-06 17:39:50
言語 Python2
(2.7.18)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 6,608 KB
実行使用メモリ 6,520 KB
最終ジャッジ日時 2023-08-24 22:41:39
合計ジャッジ時間 1,826 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,264 KB
testcase_01 AC 11 ms
5,896 KB
testcase_02 AC 69 ms
6,212 KB
testcase_03 AC 11 ms
6,328 KB
testcase_04 AC 11 ms
6,412 KB
testcase_05 AC 12 ms
6,520 KB
testcase_06 AC 13 ms
6,220 KB
testcase_07 AC 13 ms
6,412 KB
testcase_08 AC 65 ms
6,260 KB
testcase_09 AC 65 ms
6,444 KB
testcase_10 AC 80 ms
6,384 KB
testcase_11 AC 63 ms
6,288 KB
testcase_12 AC 11 ms
6,068 KB
testcase_13 AC 55 ms
6,296 KB
testcase_14 AC 45 ms
6,208 KB
testcase_15 AC 49 ms
6,328 KB
testcase_16 AC 41 ms
6,324 KB
testcase_17 AC 66 ms
6,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
def divisors(n):
    sq = int(n ** .5)
    res = ((i, n/i) for i in xrange(1, sq+1) if n%i==0)
    from itertools import chain
    flatten = chain.from_iterable
    return set(flatten(res))

n = int(raw_input())
x = n if n & 1 else n >> 1
res = sum(divisors(x))
print res
0