結果
| 問題 |
No.2880 Max Sigma Mod
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-09-10 22:25:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 395 bytes |
| コンパイル時間 | 305 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 132,656 KB |
| 最終ジャッジ日時 | 2024-09-10 22:25:43 |
| 合計ジャッジ時間 | 5,585 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | AC * 5 TLE * 1 -- * 42 |
ソースコード
def calc(x, m):
ret = 0
now = 2
i = 2
d = x // i
while i <= m:
while i + 1 <= m and d == x // (i + 1):
i += 1
ret += x * (i - now + 1) - (i - now + 1) * (i + now) // 2 * d
i += 1
d = x // i
now = i
return ret
N, M = map(int, input().split())
ans = 0
for i in range(1, N + 1):
ans = max(ans, calc(i, M))
print(ans)
ntuda