結果
| 問題 |
No.1189 Sum is XOR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 15:26:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 583 bytes |
| コンパイル時間 | 261 ms |
| コンパイル使用メモリ | 82,256 KB |
| 実行使用メモリ | 119,616 KB |
| 最終ジャッジ日時 | 2024-10-15 09:40:40 |
| 合計ジャッジ時間 | 6,794 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 20 |
ソースコード
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = [0] * 1024
for x in a: g[x] += 1
def gen(x, n, l):
if n == 0:
yield l
else:
y = x
while y:
yield from gen(x ^ y, n - 1, l + [y])
y = (y - 1) & x
ans = 0
mod = 998244353
if k > 10:
print(0)
exit(0)
for l in gen(1023, k, list()):
cur = 1
for x in l:
cur = cur * g[x] % mod
# if cur:
# print(l, cur)
ans = (ans + cur) % mod
f = 1
for i in range(1, k+1):
f = f * i % mod
print(ans * pow(f, mod-2, mod) % mod)