結果
問題 |
No.1325 Subsequence Score
|
ユーザー |
![]() |
提出日時 | 2020-12-22 02:46:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 197 ms / 2,000 ms |
コード長 | 210 bytes |
コンパイル時間 | 180 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 173,236 KB |
最終ジャッジ日時 | 2024-09-21 13:40:33 |
合計ジャッジ時間 | 4,572 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
mod = 998244353 n = int(input()) a = list(map(int, input().split())) if n == 1: print(a[0] % mod) exit() ans = 0 k = pow(2, n - 2, mod) for i in range(n): ans += k * (i + 2) * a[i] print(ans % mod)