結果
| 問題 |
No.1189 Sum is XOR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 17:11:33 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 557 bytes |
| コンパイル時間 | 124 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 28,856 KB |
| 最終ジャッジ日時 | 2024-10-15 11:11:23 |
| 合計ジャッジ時間 | 29,489 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 RE * 8 |
ソースコード
from itertools import groupby, accumulate, product, permutations, combinations
def solve():
N, K = map(int, input().split())
A = list(map(int, input().split()))
mod = 998244353
lis = [0]*(1<<10)
for i in range(N):
lis[A[i]] += 1
dp = [[0]*(1<<10) for _ in range(11)]
dp[0][0] = 1
for i in range(1,1<<10):
if lis[i]==0:
continue
for p in range(10):
for j in range(1<<10):
if i+j!=i^j:
continue
dp[p+1][i+j] += dp[p][j]*lis[i]
dp[p+1][i+j] %= mod
return sum(dp[K])%mod
print(solve())