結果

問題 No.2380 Sylow P-subgroup
ユーザー cn_449cn_449
提出日時 2023-07-14 21:30:26
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 4,126 ms
コンパイル使用メモリ 261,172 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 06:20:15
合計ジャッジ時間 4,794 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#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';
}
0