結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,528 KB
testcase_01 AC 12 ms
6,400 KB
testcase_02 AC 167 ms
40,576 KB
testcase_03 AC 12 ms
6,528 KB
testcase_04 AC 12 ms
6,400 KB
testcase_05 AC 15 ms
6,912 KB
testcase_06 AC 17 ms
7,424 KB
testcase_07 AC 17 ms
7,296 KB
testcase_08 WA -
testcase_09 AC 154 ms
38,272 KB
testcase_10 AC 193 ms
47,360 KB
testcase_11 AC 147 ms
37,248 KB
testcase_12 AC 12 ms
6,400 KB
testcase_13 AC 126 ms
32,384 KB
testcase_14 AC 102 ms
26,752 KB
testcase_15 AC 113 ms
29,056 KB
testcase_16 AC 89 ms
23,936 KB
testcase_17 AC 156 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*i == N:
                ans += i
            else:
                ans += i
                ans += v/i
    print ans
0