結果
問題 | No.1299 Random Array Score |
ユーザー |
|
提出日時 | 2020-11-27 21:41:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 109 ms / 2,000 ms |
コード長 | 1,622 bytes |
コンパイル時間 | 285 ms |
コンパイル使用メモリ | 82,352 KB |
実行使用メモリ | 107,392 KB |
最終ジャッジ日時 | 2024-07-26 12:02:11 |
合計ジャッジ時間 | 4,593 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
MOD = 998244353class ModInt:def __init__(self, x):self.x = x % MODdef __str__(self):return str(self.x)__repr__ = __str__def __add__(self, other):return (ModInt(self.x + other.x) if isinstance(other, ModInt) elseModInt(self.x + other))def __sub__(self, other):return (ModInt(self.x - other.x) if isinstance(other, ModInt) elseModInt(self.x - other))def __mul__(self, other):return (ModInt(self.x * other.x) if isinstance(other, ModInt) elseModInt(self.x * other))def __truediv__(self, other):return (ModInt(self.x * pow(other.x, MOD - 2, MOD)) if isinstance(other, ModInt) elseModInt(self.x * pow(other, MOD - 2, MOD)))__floordiv__ = __truediv__def __pow__(self, other):return (ModInt(pow(self.x, other.x, MOD)) if isinstance(other, ModInt) elseModInt(pow(self.x, other, MOD)))__radd__ = __add__def __rsub__(self, other):return (ModInt(other.x - self.x) if isinstance(other, ModInt) elseModInt(other - self.x))__rmul__ = __mul__def __rtruediv__(self, other):return (ModInt(other.x * pow(self.x, MOD - 2, MOD)) if isinstance(other, ModInt) elseModInt(other * pow(self.x, MOD - 2, MOD)))def __rpow__(self, other):return (ModInt(pow(other.x, self.x, MOD)) if isinstance(other, ModInt) elseModInt(pow(other, self.x, MOD)))N, K = map(int, input().split())A = list(map(int, input().split()))S = ModInt(sum(A))print(S*pow(ModInt(2),K))