結果
| 問題 |
No.2111 Sum of Diff
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2022-10-28 22:58:23 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 73 ms / 2,000 ms |
| コード長 | 541 bytes |
| コンパイル時間 | 6,545 ms |
| コンパイル使用メモリ | 180,224 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 02:12:01 |
| 合計ジャッジ時間 | 8,469 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace atcoder;
using namespace std;
#define mint modint998244353
int main()
{
int n;
cin >> n;
vector<mint> a(n);
rep(i, n)
{
int x;
cin >> x;
a[i] = x;
}
vector<mint> t(n);
t[0] = 1;
for (int i = 1; i < n; i++)
t[i] = 2 * t[i - 1];
mint ans = 0;
rep(i, n) ans += (t[n - 1 - i] - t[i]) * a[i];
cout << ans.val() << endl;
return 0;
}
遭難者