結果
| 問題 | No.2817 Competition |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-13 12:07:49 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 291 ms / 2,000 ms |
| + 751µs | |
| コード長 | 556 bytes |
| 記録 | |
| コンパイル時間 | 6,442 ms |
| コンパイル使用メモリ | 383,836 KB |
| 実行使用メモリ | 14,848 KB |
| 最終ジャッジ日時 | 2026-08-13 04:44:27 |
| 合計ジャッジ時間 | 10,758 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#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";
}