結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー ああいいああいい
提出日時 2022-03-17 23:54:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,711 ms / 5,000 ms
コード長 219 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 260,212 KB
最終ジャッジ日時 2024-04-09 22:13:46
合計ジャッジ時間 12,364 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,284 KB
testcase_01 AC 44 ms
61,668 KB
testcase_02 AC 43 ms
62,468 KB
testcase_03 AC 44 ms
61,964 KB
testcase_04 AC 41 ms
59,868 KB
testcase_05 AC 48 ms
64,036 KB
testcase_06 AC 40 ms
60,896 KB
testcase_07 AC 1,711 ms
259,956 KB
testcase_08 AC 1,270 ms
260,212 KB
testcase_09 AC 922 ms
260,196 KB
testcase_10 AC 1,082 ms
260,140 KB
testcase_11 AC 1,372 ms
259,648 KB
testcase_12 AC 46 ms
63,872 KB
testcase_13 AC 37 ms
60,016 KB
testcase_14 AC 838 ms
258,568 KB
testcase_15 AC 1,414 ms
259,776 KB
testcase_16 AC 44 ms
63,224 KB
testcase_17 AC 412 ms
259,820 KB
testcase_18 AC 1,487 ms
260,000 KB
testcase_19 AC 250 ms
200,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))

C = 1 << 15
dp = [0] * (C + 1)
dp[0] = 1
for a in A:
    nx = dp.copy()
    for i in range(C+1):
        if dp[i]:
            nx[i^a] = 1
    dp = nx
print(sum(dp))
0