結果
問題 | No.2902 ZERO!! |
ユーザー |
|
提出日時 | 2024-09-27 20:27:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 366 ms / 2,000 ms |
コード長 | 605 bytes |
コンパイル時間 | 283 ms |
コンパイル使用メモリ | 82,000 KB |
実行使用メモリ | 103,988 KB |
最終ジャッジ日時 | 2024-09-27 20:27:44 |
合計ジャッジ時間 | 7,612 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
N = int(input())MOD = 998244353DP = [i for i in range(N + 1)]R = {}for i in range(2, N + 1):t = DP[i]if t != 1:if t not in R:R[t] = 0for j in range(i, N + 1, i):DP[j] //= tR[t] += 1M = R[2]DP = [0] * (M + 1)L = list(R.values())for i in range(1, M + 1):t = 1for j in range(len(L) - 1, -1, -1):if L[j] < i:L.pop()else:n = L[j] // it *= n + 1t %= MODDP[i] = (t - 1) % MODans = 0for i in range(1, M + 1):if i != M:DP[i] -= DP[i + 1]DP[i] %= MODans += DP[i] * i % MODans %= MODprint(ans)