結果
問題 | No.278 連続する整数の和(2) |
ユーザー |
👑 |
提出日時 | 2020-08-19 23:17:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 252 ms / 2,000 ms |
コード長 | 235 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-10-12 08:52:45 |
合計ジャッジ時間 | 3,124 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
from math import gcd n = int(input()) n2 = n * (n - 1) // 2 x = gcd(n, n2) ans = 0 for i in range(1, int(x ** 0.5) + 1): if x % i == 0: ans += i ans += x // i if x == i ** 2: ans -= i print(ans)