結果
| 問題 |
No.278 連続する整数の和(2)
|
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2017-08-24 14:42:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 281 bytes |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-15 14:18:32 |
| 合計ジャッジ時間 | 1,395 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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