結果

問題 No.1189 Sum is XOR
ユーザー 37zigen37zigen
提出日時 2020-08-26 21:13:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,839 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 105,344 KB
最終ジャッジ日時 2024-04-25 03:48:02
合計ジャッジ時間 15,635 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,138 ms
105,088 KB
testcase_01 AC 1,831 ms
105,344 KB
testcase_02 AC 1,839 ms
105,344 KB
testcase_03 AC 57 ms
77,184 KB
testcase_04 AC 54 ms
74,880 KB
testcase_05 AC 65 ms
85,760 KB
testcase_06 AC 77 ms
97,920 KB
testcase_07 AC 59 ms
79,872 KB
testcase_08 AC 46 ms
66,688 KB
testcase_09 AC 47 ms
66,944 KB
testcase_10 AC 46 ms
64,256 KB
testcase_11 AC 258 ms
80,128 KB
testcase_12 AC 1,134 ms
105,088 KB
testcase_13 AC 1,516 ms
101,504 KB
testcase_14 AC 972 ms
91,008 KB
testcase_15 AC 270 ms
80,128 KB
testcase_16 AC 246 ms
76,928 KB
testcase_17 AC 368 ms
79,232 KB
testcase_18 AC 427 ms
84,352 KB
testcase_19 AC 1,292 ms
95,872 KB
testcase_20 AC 1,316 ms
95,872 KB
testcase_21 AC 49 ms
61,184 KB
testcase_22 AC 47 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|s][i+1]=(dp[a|s][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