結果

問題 No.1299 Random Array Score
ユーザー ttkkggwwttkkggww
提出日時 2020-11-27 22:00:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 1,966 ms
コンパイル使用メモリ 194,488 KB
最終ジャッジ日時 2025-01-16 07:18:44
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
using ll = long long;
const ll MOD = 998244353;

ll modpow(ll x,ll y){
	ll res = 1;
	while(y){
		if(y%2)(res*=x)%=MOD;
		(x*=x)%=MOD;
		y/=2;
	}
	return res;
}

int main()
{
	ll n,k;
	cin >> n >> k;
	vector<ll> a(n);
	for(ll i=0;i<n;i++){
		cin >> a[i];
	}
	ll sum = 0;
	for(auto &i:a)(sum += i)%=MOD;
	(sum*=modpow(2,k))%=MOD;
	cout<<sum<<endl;

}
0