結果
問題 |
No.278 連続する整数の和(2)
|
ユーザー |
![]() |
提出日時 | 2015-09-05 21:59:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 392 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 20,764 KB |
最終ジャッジ日時 | 2024-07-19 04:16:31 |
合計ジャッジ時間 | 2,862 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 3 |
ソースコード
def divisors(n): rt = int(n ** 0.5) + 1 s = [False] * rt s[1] = True for x in range(2, rt): if n % x == 0: s[x] = True return (i for i in range(rt) if s[i]) def solve(): N = int(input()) g = N if N % 2 else N // 2 s = 0 for d in divisors(g): s += d s += g // d print(s) if __name__ == '__main__': solve()