結果
| 問題 |
No.1299 Random Array Score
|
| コンテスト | |
| ユーザー |
hanyu
|
| 提出日時 | 2020-11-28 00:09:58 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| コード長 | 539 bytes |
| コンパイル時間 | 2,007 ms |
| コンパイル使用メモリ | 194,112 KB |
| 最終ジャッジ日時 | 2025-01-16 08:46:15 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
static const ll MOD = 998244353;
ll power(ll x, ll n) {
ll res = 1;
while (n > 0) {
if (n & 1LL) {
res *= x;
res %= MOD;
}
x = (x * x) % MOD;
n >>= 1;
}
return res;
}
ll modinv(ll x) {
return power(x, MOD - 2);
}
int main() {
ll n, k;
cin >> n >> k;
vector<ll> a(n);
ll sum = 0;
for (int i = 0; i < n; i++) {
cin >> a.at(i);
sum += a.at(i);
}
sum %= MOD;
cout << (sum * power(2, k)) % MOD << endl;
}
hanyu