結果

問題 No.2817 Competition
ユーザー 沙耶花沙耶花
提出日時 2024-07-19 22:22:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 483 ms / 2,000 ms
コード長 763 bytes
コンパイル時間 4,774 ms
コンパイル使用メモリ 274,416 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2024-07-19 22:22:24
合計ジャッジ時間 10,168 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 457 ms
14,592 KB
testcase_04 AC 483 ms
14,592 KB
testcase_05 AC 456 ms
14,592 KB
testcase_06 AC 453 ms
14,592 KB
testcase_07 AC 455 ms
14,592 KB
testcase_08 AC 52 ms
5,376 KB
testcase_09 AC 103 ms
6,144 KB
testcase_10 AC 157 ms
7,680 KB
testcase_11 AC 300 ms
10,752 KB
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 117 ms
6,656 KB
testcase_14 AC 177 ms
8,320 KB
testcase_15 AC 91 ms
6,144 KB
testcase_16 AC 193 ms
8,576 KB
testcase_17 AC 129 ms
7,168 KB
testcase_18 AC 458 ms
14,720 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001


int main(){
	
	
	int n;
	cin>>n;
	queue<vector<mint>> Q;
	rep(i,n){
		long long a;
		cin>>a;
		vector<mint> v;
		v.push_back(1);
		v.push_back(a);
		Q.push(v);
	}
	while(Q.size()>=2){
		vector<mint> v1=Q.front();
		Q.pop();
		vector<mint> v2=Q.front();
		Q.pop();
		vector<mint> v3 = convolution(v1,v2);
		Q.push(v3);
	}
	mint kaijou = 1;
	mint ans = 0;
	for(int i=1;i<=n;i++){
		mint t = Q.front()[i];
		t *= mint(i).pow(n-i);
		kaijou /= i;
		//t *= kaijou;
		ans += t;
	}
	cout<<ans.val()<<endl;
	return 0;
}
0