結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kiccho1101kiccho1101
提出日時 2022-04-23 18:45:23
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 352 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 840,164 KB
最終ジャッジ日時 2023-09-07 11:10:41
合計ジャッジ時間 5,600 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
76,864 KB
testcase_01 AC 84 ms
77,404 KB
testcase_02 AC 97 ms
78,880 KB
testcase_03 AC 95 ms
78,396 KB
testcase_04 AC 84 ms
77,112 KB
testcase_05 AC 96 ms
79,080 KB
testcase_06 AC 89 ms
77,752 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(map(int, input().split()))

# dp[i][j]:  i番目までの数字でjにできるかどうか
dp = [[False] * (25001) for _ in range(N + 1)]

dp[0][0] = True
for i in range(N):
    for j in range(25001):
        dp[i + 1][j] = dp[i][j]
        if j ^ A[i] < 25001:
            dp[i + 1][j] |= dp[i][j ^ A[i]]

print(sum(dp[N]))
0