結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー ああいいああいい
提出日時 2021-12-24 15:11:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 286 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 602,244 KB
最終ジャッジ日時 2023-10-19 17:21:03
合計ジャッジ時間 7,689 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
10,412 KB
testcase_01 AC 43 ms
10,684 KB
testcase_02 AC 59 ms
11,732 KB
testcase_03 AC 52 ms
11,468 KB
testcase_04 AC 36 ms
10,420 KB
testcase_05 AC 63 ms
11,740 KB
testcase_06 AC 43 ms
10,940 KB
testcase_07 MLE -
testcase_08 MLE -
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 = [[0] * ((1 << 14) + 1) for _ in range(N)]
dp[0][0] = 1
dp[0][A[0]] = 1
for i in range(N-1):
    for j in range((1 << 14) + 1):
        if dp[i][j]:
            dp[i+1][j^A[i+1]] = 1
            dp[i+1][j] = 1
print(sum(dp[N-1]))
0