結果

問題 No.278 連続する整数の和(2)
ユーザー tnoda_tnoda_
提出日時 2015-09-08 13:53:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 334 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 6,476 KB
実行使用メモリ 6,216 KB
最終ジャッジ日時 2023-08-24 22:42:37
合計ジャッジ時間 3,461 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,176 KB
testcase_01 AC 12 ms
6,044 KB
testcase_02 AC 290 ms
6,036 KB
testcase_03 AC 11 ms
6,172 KB
testcase_04 AC 11 ms
6,100 KB
testcase_05 AC 16 ms
5,980 KB
testcase_06 AC 19 ms
6,068 KB
testcase_07 AC 19 ms
6,004 KB
testcase_08 AC 264 ms
6,016 KB
testcase_09 AC 263 ms
5,980 KB
testcase_10 AC 334 ms
6,008 KB
testcase_11 AC 255 ms
6,012 KB
testcase_12 AC 11 ms
6,068 KB
testcase_13 AC 217 ms
6,004 KB
testcase_14 AC 171 ms
5,976 KB
testcase_15 AC 189 ms
6,004 KB
testcase_16 AC 149 ms
6,216 KB
testcase_17 AC 269 ms
6,000 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