結果

問題 No.2113 Distance Sequence 1.5
ユーザー kotatsugamekotatsugame
提出日時 2022-10-04 21:28:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 66,124 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 11:13:33
合計ジャッジ時間 1,867 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
long N,M,K;
int main()
{
	cin>>N>>M>>K;
	if(M<=K)cout<<mint(M).pow(2*N).val()<<endl;
	else cout<<(mint(K).pow(2*N)*(M-K+1)-mint(K-1).pow(2*N)*(M-K)).val()<<endl;
}
0