結果
| 問題 | No.278 連続する整数の和(2) |
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2017-08-24 14:42:12 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 281 bytes |
| 記録 | |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-04 17:58:38 |
| 合計ジャッジ時間 | 3,388 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 18 |
ソースコード
import math
n = int(input())
m = int(n * (n + 1) / 2)
x = math.gcd(n, m)
ret = i = 1
while i * i <= x:
i += 1
cnt = 1
while x % i == 0:
x /= i
cnt += 1
print(i, cnt - 1)
ret *= (i**cnt - 1) / (i - 1)
ret *= x + 1 if x > 1 else 1
print(int(ret))
fiord