結果
問題 | No.2380 Sylow P-subgroup |
ユーザー |
|
提出日時 | 2023-07-14 21:26:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 4,452 ms |
コンパイル使用メモリ | 250,916 KB |
最終ジャッジ日時 | 2025-02-15 10:36:40 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;#include <atcoder/all>using mint = atcoder::modint998244353;int main() {long long N, P;cin >> N >> P;long long c = 0, k = P;for (int i = 0; i < 100; i++){c += N / k;k *= P;if (k > N){break;}}mint ans = mint(P).pow(c);cout << ans.val() << '\n';}