結果

問題 No.278 連続する整数の和(2)
ユーザー niyarinniyarin
提出日時 2016-11-08 20:05:42
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 47,360 KB
最終ジャッジ日時 2024-05-03 23:45:59
合計ジャッジ時間 2,413 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 12 ms
6,272 KB
testcase_02 AC 170 ms
40,448 KB
testcase_03 AC 13 ms
6,400 KB
testcase_04 AC 12 ms
6,400 KB
testcase_05 AC 17 ms
7,040 KB
testcase_06 AC 17 ms
7,552 KB
testcase_07 AC 16 ms
7,424 KB
testcase_08 AC 155 ms
38,272 KB
testcase_09 WA -
testcase_10 AC 189 ms
47,360 KB
testcase_11 AC 145 ms
37,248 KB
testcase_12 AC 12 ms
6,272 KB
testcase_13 AC 126 ms
32,384 KB
testcase_14 AC 103 ms
26,880 KB
testcase_15 AC 107 ms
28,928 KB
testcase_16 AC 89 ms
23,808 KB
testcase_17 AC 152 ms
39,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import *
N = input()
if N == 1:
    print 1
elif N == 2:
    print 1
else:
    v = N if N%2 else N/2
    ans = 0
    sn = int(sqrt(v))
    for i in range(1,sn+1):
        if v % i == 0:
            if i == sn:
                ans += i
            else:
                ans += i
                ans += v/i
    print ans



    


0