結果
問題 | No.2380 Sylow P-subgroup |
ユーザー |
|
提出日時 | 2023-07-14 21:35:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 339 bytes |
コンパイル時間 | 3,895 ms |
コンパイル使用メモリ | 251,224 KB |
最終ジャッジ日時 | 2025-02-15 13:44:49 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using ll = long long;#define rep(i,n) for(int i=0;i<(int)(n);i++)using mint = atcoder::modint998244353;ll dn(ll x,ll p){ll rt=0;while(x>0){rt+=x/p;x/=p;}return rt;}int main(){ll n,p;cin>>n>>p;ll m=dn(n,p);cout<<mint(p).pow(m).val()<<endl;}