結果
| 問題 | No.1325 Subsequence Score |
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2020-12-22 02:54:18 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 104 ms / 2,000 ms |
| コード長 | 256 bytes |
| 記録 | |
| コンパイル時間 | 112 ms |
| コンパイル使用メモリ | 85,160 KB |
| 実行使用メモリ | 155,516 KB |
| 最終ジャッジ日時 | 2026-04-09 19:04:14 |
| 合計ジャッジ時間 | 3,069 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
mod = 998244353
if N == 1:
print(A[0] % mod)
exit()
ans = 0
cnt = pow(2, N - 1, mod)
d = pow(2, N - 2, mod)
for a in A:
ans += a * cnt
ans %= mod
cnt += d
cnt %= mod
print(ans)
tktk_snsn