結果
問題 | No.2576 LCM Pattern |
ユーザー |
![]() |
提出日時 | 2023-12-24 19:35:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 703 bytes |
コンパイル時間 | 4,554 ms |
コンパイル使用メモリ | 255,808 KB |
最終ジャッジ日時 | 2025-02-18 14:14:07 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; using namespace chrono; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif int main() { int64_t n, m; cin >> n >> m; using mint = modint998244353; map<int64_t, int64_t> mp; { int64_t x = m; for (int64_t i = 2; i * i <= x; i++) { while (x % i == 0) { mp[i]++; x /= i; } } if (1 < x) { mp[x]++; } } mint ans = 1; for (auto [a, e] : mp) { ans *= mint(e + 1).pow(n) - mint(e).pow(n); } cout << ans.val() << endl; return 0; }