結果
| 問題 |
No.2891 Mint
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-13 22:52:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 639 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 82,464 KB |
| 実行使用メモリ | 82,504 KB |
| 最終ジャッジ日時 | 2024-09-13 22:52:39 |
| 合計ジャッジ時間 | 3,799 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 54 |
ソースコード
# 入力を受け取る
M, N = map(int, input().split())
# 「増加分」の計算 O(√x)
def calc(x : int):
res = M
i = 1
while i * i <= x:
if x % i == 0:
if i <= M: res -= i
# i * i == x の時は i == x / i なので重複してしまう
if i * i != x and x // i <= M: res -= x // i
i += 1
return res
# 1 <= x <= N を満たすxについて sum(x mod i) の最大値を計算
MOD = 998244353
res = 0
modsum = 0
for x in range(1, N + 1):
modsum = (modsum + calc(x)) % MOD
# res = max(res, modsum)
# print(modsum, res)
print(modsum)
# print(res)
#