結果
問題 | No.2113 Distance Sequence 1.5 |
ユーザー |
|
提出日時 | 2024-09-24 21:47:27 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 361 bytes |
コンパイル時間 | 2,004 ms |
コンパイル使用メモリ | 203,220 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 21:47:30 |
合計ジャッジ時間 | 2,734 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll=long long;#include<atcoder/modint>using mint=atcoder::modint998244353;int main(){ll N,M,K;cin>>N>>M>>K;if(M<K){cout<<mint(M).pow(2*N).val()<<endl;return 0;}mint an=mint(M-K)*(mint(K).pow(2*N)-mint(K-1).pow(2*N))+mint(K).pow(2*N);cout<<an.val()<<endl;}