結果

問題 No.278 連続する整数の和(2)
ユーザー tnoda_tnoda_
提出日時 2015-09-08 13:47:29
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 6,208 KB
最終ジャッジ日時 2023-09-26 10:07:29
合計ジャッジ時間 2,356 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,204 KB
testcase_01 AC 11 ms
6,200 KB
testcase_02 AC 284 ms
5,940 KB
testcase_03 AC 12 ms
5,972 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 19 ms
5,936 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 268 ms
5,968 KB
testcase_10 AC 333 ms
5,972 KB
testcase_11 WA -
testcase_12 AC 11 ms
6,060 KB
testcase_13 WA -
testcase_14 AC 179 ms
6,000 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 269 ms
5,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
if N % 2 == 0:
    print(1)
    quit()
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