結果
問題 | No.2380 Sylow P-subgroup |
ユーザー |
|
提出日時 | 2023-07-14 22:03:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 5,228 ms |
コンパイル使用メモリ | 308,620 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-16 07:05:40 |
合計ジャッジ時間 | 5,515 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif using namespace std; using ll = long long; using mint = modint998244353; int main() { ll n; int p; cin >> n >> p; ll k = 0; while (n) { k += n/p; n /= p; } cout << mint(p).pow(k).val() << '\n'; return 0; }