結果

問題 No.1189 Sum is XOR
ユーザー 37zigen37zigen
提出日時 2020-08-26 20:48:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 105,344 KB
最終ジャッジ日時 2024-04-25 03:46:37
合計ジャッジ時間 16,693 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 WA -
testcase_03 AC 63 ms
77,184 KB
testcase_04 AC 61 ms
75,136 KB
testcase_05 AC 71 ms
85,888 KB
testcase_06 AC 84 ms
97,536 KB
testcase_07 AC 66 ms
79,872 KB
testcase_08 AC 55 ms
66,176 KB
testcase_09 AC 55 ms
67,200 KB
testcase_10 AC 53 ms
64,512 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 54 ms
60,800 KB
testcase_22 AC 52 ms
61,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=998244353
N,K=map(int,input().split())
A=list(map(int,input().split()))
if K>10:
    exit(print(0))
dp=[[0]*11 for _ in range(1<<10)]
dp[0][0]=1
for a in A:
    s=(~a)&((1<<10)-1)
    while True:
        for i in range(10):
            dp[a][i+1]=(dp[a][i+1]+dp[s][i])%MOD
        if s==0:
            break
        s=(s-1)&(~a)
ans=0
for i in range(1,1<<10):
    ans=(ans+dp[i][K])%MOD
print(ans)
0