結果
問題 |
No.1325 Subsequence Score
|
ユーザー |
👑 ![]() |
提出日時 | 2020-12-22 20:10:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 220 ms / 2,000 ms |
コード長 | 349 bytes |
コンパイル時間 | 1,892 ms |
コンパイル使用メモリ | 190,796 KB |
最終ジャッジ日時 | 2025-01-17 06:08:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include<bits/stdc++.h> using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const ULL M=998244353; const int Z=500000; int N; ULL A[Z]; int main(){ cin>>N; rep(i,N) cin>>A[i]; ULL a=0; rep(i,N) a+=(i+2)*A[i]%M; a%=M; rep(i,N-1) a=a*2%M; a=a*(M/2+1)%M; cout<<a<<endl; return 0; }