結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kiccho1101kiccho1101
提出日時 2022-04-23 18:48:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 1,733 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 260,144 KB
最終ジャッジ日時 2023-09-07 11:12:20
合計ジャッジ時間 35,270 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
77,004 KB
testcase_01 AC 80 ms
77,700 KB
testcase_02 AC 86 ms
79,652 KB
testcase_03 AC 82 ms
79,132 KB
testcase_04 AC 77 ms
77,316 KB
testcase_05 AC 90 ms
79,632 KB
testcase_06 AC 82 ms
78,160 KB
testcase_07 WA -
testcase_08 AC 4,016 ms
259,932 KB
testcase_09 AC 2,796 ms
259,820 KB
testcase_10 AC 3,356 ms
259,876 KB
testcase_11 AC 4,344 ms
259,708 KB
testcase_12 WA -
testcase_13 AC 72 ms
76,412 KB
testcase_14 AC 3,711 ms
259,676 KB
testcase_15 AC 4,499 ms
259,844 KB
testcase_16 AC 86 ms
79,188 KB
testcase_17 AC 1,140 ms
259,684 KB
testcase_18 WA -
testcase_19 AC 584 ms
214,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

M = 32763

# dp[i][j]:  i番目までの数字でjにできるかどうか
dp = [False] * (M + 1)
dp[0] = True
for i in range(N):
    ndp = [False] * (M + 1)
    for j in range(M + 1):
        ndp[j] = dp[j]
        if j ^ A[i] < M + 1:
            ndp[j] |= dp[j ^ A[i]]
    dp = ndp

print(sum(dp))
0