結果
| 問題 |
No.2380 Sylow P-subgroup
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-14 21:50:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 354 bytes |
| コンパイル時間 | 3,921 ms |
| コンパイル使用メモリ | 229,948 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-16 06:46:23 |
| 合計ジャッジ時間 | 4,383 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353;
int main(void) {
long long n;
cin >> n;
int P;
cin >> P;
long long p=P;
long long ans=0;
while(n>=p){
ans+=n/p;
p*=P;
}
cout << (mint(P).pow(ans)).val() << endl;
return 0;
}