結果

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

ソースコード

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;
	(sum*=modpow(2,k))%=MOD;
	cout<<sum<<endl;

}
0