結果

問題 No.1325 Subsequence Score
ユーザー 夜
提出日時 2020-12-22 02:33:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 910 ms
コンパイル使用メモリ 92,044 KB
実行使用メモリ 7,492 KB
最終ジャッジ日時 2023-10-21 12:22:06
合計ジャッジ時間 4,692 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 220 ms
7,432 KB
testcase_14 AC 64 ms
6,304 KB
testcase_15 AC 189 ms
6,812 KB
testcase_16 AC 209 ms
7,240 KB
testcase_17 AC 93 ms
6,304 KB
testcase_18 AC 55 ms
6,304 KB
testcase_19 AC 222 ms
7,480 KB
testcase_20 AC 31 ms
4,348 KB
testcase_21 AC 76 ms
6,304 KB
testcase_22 AC 97 ms
6,304 KB
testcase_23 AC 225 ms
7,492 KB
testcase_24 AC 223 ms
7,492 KB
testcase_25 AC 222 ms
7,492 KB
testcase_26 AC 224 ms
7,492 KB
testcase_27 AC 224 ms
7,492 KB
testcase_28 WA -
testcase_29 AC 2 ms
4,348 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[500050];
long long mod = 998244353;
int main() {
	long long n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	long long t = 1;
	for (int i = 0; i < n - 2; i++) {
		t *= 2;
		t %= mod;
	}
	long long ans = 0, t1 = t;
	for (int i = 0; i < n; i++) {
		t1 += t;
		t1 %= mod;
		ans += t1 * a[i] % mod;
		ans %= mod;
	}
	cout << ans << endl;
}
0