結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
10,736 KB
testcase_01 AC 58 ms
10,736 KB
testcase_02 AC 145 ms
10,736 KB
testcase_03 AC 125 ms
10,736 KB
testcase_04 AC 64 ms
10,736 KB
testcase_05 AC 149 ms
10,736 KB
testcase_06 AC 91 ms
10,736 KB
testcase_07 TLE -
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)

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