結果
| 問題 | No.1299 Random Array Score | 
| コンテスト | |
| ユーザー |  yamake | 
| 提出日時 | 2020-11-27 21:47:50 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 89 ms / 2,000 ms | 
| コード長 | 798 bytes | 
| コンパイル時間 | 870 ms | 
| コンパイル使用メモリ | 78,224 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-26 12:12:38 | 
| 合計ジャッジ時間 | 4,105 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 34 | 
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cstdio>
#include<cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define debug(output) cout<<#output<<"= "<<output<<endl
using lint=long long;
int MOD=998244353;
long long myPow(long long x, long long n, long long m){
        if(n == 0)
            return 1;
        if(n % 2 == 0)
            return myPow(x * x % m, n / 2, m);
        else
            return x * myPow(x, n - 1, m) % m;
    }
signed main(){
    lint n,k;cin>>n>>k;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    lint res=0;
    rep(i,n)res+=a[i];
    res%=MOD;
    res*=myPow(2,k,MOD);
    res%=MOD;
    cout<<res<<"\n";
    return 0;
}
            
            
            
        