結果
| 問題 |
No.1299 Random Array Score
|
| ユーザー |
y61mpnl
|
| 提出日時 | 2020-11-27 22:21:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 533 bytes |
| コンパイル時間 | 2,004 ms |
| コンパイル使用メモリ | 191,268 KB |
| 最終ジャッジ日時 | 2025-01-16 07:44:08 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:15: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘ll*’ {aka ‘long int*’} [-Wformat=]
18 | scanf("%lld %lld", &n, &k);
| ~~~^ ~~
| | |
| | ll* {aka long int*}
| long long int*
| %ld
main.cpp:18:20: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 3 has type ‘ll*’ {aka ‘long int*’} [-Wformat=]
18 | scanf("%lld %lld", &n, &k);
| ~~~^ ~~
| | |
| | ll* {aka long int*}
| long long int*
| %ld
main.cpp:22:19: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘ll*’ {aka ‘long int*’} [-Wformat=]
22 | scanf("%lld", &a);
| ~~~^ ~~
| | |
| | ll* {aka long int*}
| long long int*
| %ld
main.cpp:28:16: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘ll’ {aka ‘long int’} [-Wformat=]
28 | printf("%lld\n", ans);
| ~~~^ ~~~
| | |
| | ll {aka long int}
| long long int
| %ld
main.cpp:18:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
18 | scanf("%lld %lld", &n, &k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
22 | scanf("%lld", &a);
| ~~~~~^~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
#define REP(i,b,e) for(int i=b;i<e;i++)
using ll = int_fast64_t;
const ll MOD = 998244353;
ll modpow(ll a, ll p, ll m){
ll ret = 1;
while(p){
if(p&1) ret = ret * a % m;
a = a * a % m;
p >>= 1;
}
return ret;
}
int main(){
ll n, k;
scanf("%lld %lld", &n, &k);
ll sum = 0;
REP(i, 0, n){
ll a;
scanf("%lld", &a);
sum += a;
}
ll ans = modpow(2, k, MOD);
ans = ans * sum % MOD;
printf("%lld\n", ans);
return 0;
}
y61mpnl