結果

問題 No.1299 Random Array Score
ユーザー 👑 tamatotamato
提出日時 2020-11-27 21:38:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 87,364 KB
実行使用メモリ 103,980 KB
最終ジャッジ日時 2023-10-01 05:05:54
合計ジャッジ時間 7,064 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,616 KB
testcase_01 AC 72 ms
71,348 KB
testcase_02 AC 71 ms
71,636 KB
testcase_03 AC 130 ms
99,756 KB
testcase_04 AC 126 ms
99,540 KB
testcase_05 AC 110 ms
99,784 KB
testcase_06 AC 105 ms
96,812 KB
testcase_07 AC 106 ms
96,984 KB
testcase_08 AC 127 ms
99,596 KB
testcase_09 AC 77 ms
76,272 KB
testcase_10 AC 91 ms
86,584 KB
testcase_11 AC 78 ms
76,820 KB
testcase_12 AC 104 ms
94,596 KB
testcase_13 AC 127 ms
99,436 KB
testcase_14 AC 103 ms
94,700 KB
testcase_15 AC 108 ms
96,772 KB
testcase_16 AC 105 ms
96,640 KB
testcase_17 AC 80 ms
78,100 KB
testcase_18 AC 93 ms
88,036 KB
testcase_19 AC 95 ms
89,944 KB
testcase_20 AC 85 ms
82,628 KB
testcase_21 AC 77 ms
76,092 KB
testcase_22 AC 82 ms
78,584 KB
testcase_23 AC 105 ms
96,752 KB
testcase_24 AC 110 ms
99,912 KB
testcase_25 AC 102 ms
94,604 KB
testcase_26 AC 77 ms
76,052 KB
testcase_27 AC 83 ms
79,480 KB
testcase_28 AC 82 ms
77,792 KB
testcase_29 AC 85 ms
80,624 KB
testcase_30 AC 102 ms
94,416 KB
testcase_31 AC 88 ms
80,796 KB
testcase_32 AC 125 ms
100,172 KB
testcase_33 AC 130 ms
99,604 KB
testcase_34 AC 108 ms
103,664 KB
testcase_35 AC 127 ms
99,760 KB
testcase_36 AC 109 ms
103,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    s = 0
    for a in A:
        s = (s + a)%mod
    x = (s * pow(N, mod-2, mod))%mod
    print((s + ((x * N)%mod * (pow(2, K, mod) - 1)%mod)%mod)%mod)


if __name__ == '__main__':
    main()
0