結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
6,400 KB
testcase_01 AC 12 ms
6,400 KB
testcase_02 AC 163 ms
40,320 KB
testcase_03 AC 12 ms
6,528 KB
testcase_04 AC 12 ms
6,272 KB
testcase_05 AC 14 ms
7,040 KB
testcase_06 AC 16 ms
7,424 KB
testcase_07 AC 17 ms
7,424 KB
testcase_08 WA -
testcase_09 AC 150 ms
38,272 KB
testcase_10 AC 188 ms
47,360 KB
testcase_11 AC 143 ms
37,248 KB
testcase_12 AC 13 ms
6,400 KB
testcase_13 AC 126 ms
32,384 KB
testcase_14 AC 97 ms
26,752 KB
testcase_15 AC 108 ms
28,928 KB
testcase_16 AC 89 ms
23,936 KB
testcase_17 AC 153 ms
39,168 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*i == N:
                ans += i
            else:
                ans += i
                ans += v/i
    print ans



    


0