結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー qewqewqewqewqewqew
提出日時 2018-12-15 02:34:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 289 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 11,796 KB
実行使用メモリ 815,516 KB
最終ジャッジ日時 2023-10-25 10:41:28
合計ジャッジ時間 3,331 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
10,964 KB
testcase_01 AC 67 ms
10,964 KB
testcase_02 AC 190 ms
13,604 KB
testcase_03 AC 159 ms
13,076 KB
testcase_04 AC 80 ms
11,228 KB
testcase_05 AC 195 ms
13,868 KB
testcase_06 AC 114 ms
12,020 KB
testcase_07 MLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(set(map(int, input().split())))
n = len(a)

# ver2 DP
dp = [[False]*(2**15) for i in range(n+1)]
dp[0][0] = True
for i in range(n):
    for k in range(2**15):
        #print(k,a[i],k^a[i])
        dp[i+1][k] = dp[i][k] or dp[i][k^a[i]]
        
print(sum(dp[-1]))
0