結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー tnodinotnodino
提出日時 2022-07-07 17:58:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,694 ms / 5,000 ms
コード長 251 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 259,996 KB
最終ジャッジ日時 2023-08-26 04:49:12
合計ジャッジ時間 12,196 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
76,808 KB
testcase_01 AC 74 ms
77,580 KB
testcase_02 AC 75 ms
79,564 KB
testcase_03 AC 72 ms
78,908 KB
testcase_04 AC 68 ms
76,952 KB
testcase_05 AC 76 ms
79,616 KB
testcase_06 AC 72 ms
77,648 KB
testcase_07 AC 1,694 ms
259,932 KB
testcase_08 AC 1,174 ms
259,932 KB
testcase_09 AC 856 ms
259,908 KB
testcase_10 AC 1,004 ms
259,904 KB
testcase_11 AC 1,232 ms
259,812 KB
testcase_12 AC 76 ms
80,020 KB
testcase_13 AC 70 ms
76,152 KB
testcase_14 AC 595 ms
259,928 KB
testcase_15 AC 1,275 ms
259,992 KB
testcase_16 AC 75 ms
78,856 KB
testcase_17 AC 421 ms
259,964 KB
testcase_18 AC 1,417 ms
259,996 KB
testcase_19 AC 285 ms
214,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M = 2**15
N = int(input())
A = list(map(int,input().split()))
DP = [0] * (M+1)
DP[0] = 1
for i in range(N):
    DP2 = [0] * (M+1)
    for j in range(M+1):
        if DP[j]:
            DP2[j] = 1
            DP2[j^A[i]] = 1
    DP = DP2
print(sum(DP))
0