結果

問題 No.278 連続する整数の和(2)
ユーザー tnoda_tnoda_
提出日時 2015-09-08 13:53:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 73 ms
使用メモリ 6,288 KB
最終ジャッジ日時 2023-01-12 15:55:06
合計ジャッジ時間 3,617 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 10 ms
6,200 KB
testcase_01 AC 11 ms
6,024 KB
testcase_02 AC 268 ms
5,996 KB
testcase_03 AC 11 ms
6,248 KB
testcase_04 AC 11 ms
6,244 KB
testcase_05 AC 15 ms
6,144 KB
testcase_06 AC 18 ms
6,288 KB
testcase_07 AC 19 ms
5,992 KB
testcase_08 AC 251 ms
5,996 KB
testcase_09 AC 252 ms
6,008 KB
testcase_10 AC 320 ms
6,256 KB
testcase_11 AC 244 ms
6,196 KB
testcase_12 AC 11 ms
6,284 KB
testcase_13 AC 208 ms
6,268 KB
testcase_14 AC 165 ms
6,004 KB
testcase_15 AC 181 ms
6,012 KB
testcase_16 AC 144 ms
6,136 KB
testcase_17 AC 258 ms
5,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
if N % 2 == 0:
    N /= 2
ans = 0
i = 1
while N >= i * i:
    if N == i * i:
        ans += i
        i += 1
        break
    elif N % i == 0:
        ans += (N / i) + i
        i += 1
    else:
        i += 1
print(ans)
0