結果
問題 | No.2380 Sylow P-subgroup |
ユーザー |
![]() |
提出日時 | 2023-07-14 21:30:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 3,802 ms |
コンパイル使用メモリ | 251,020 KB |
最終ジャッジ日時 | 2025-02-15 10:42:04 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;#include <atcoder/all>using namespace atcoder;using mint = modint998244353;int main(){ll n, p;cin >> n >> p;ll cnt = 0;while(n > 0){cnt += n / p;n /= p;}mint v = mint(p).pow(cnt);cout << v.val() << '\n';}