結果

問題 No.2817 Competition
ユーザー hirayuu_yc
提出日時 2024-07-13 12:07:49
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 444 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 6,885 ms
コンパイル使用メモリ 338,280 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2024-07-13 12:08:04
合計ジャッジ時間 13,708 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
int main(){
	int N;
	std::cin>>N;
	std::queue<std::vector<atcoder::modint998244353>> poly;
	for(int i=0; i<N; i++){
		long long A;
		std::cin>>A;
		poly.push({1,A});
	}
	while(poly.size()>1){
	    std::vector<atcoder::modint998244353> bef=move(poly.front());
	    poly.pop();
	    poly.push(atcoder::convolution(bef,poly.front()));
	    poly.pop();
	}
	atcoder::modint998244353 ans=0;
	for(int i=0; i<=N; i++){
	    ans+=(atcoder::modint998244353(i).pow(N-i))*poly.front()[i];
	}
	std::cout<<ans.val()<<"\n";
}
0