結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,620 KB
testcase_01 AC 77 ms
77,388 KB
testcase_02 AC 87 ms
78,752 KB
testcase_03 AC 86 ms
78,356 KB
testcase_04 AC 78 ms
77,172 KB
testcase_05 AC 89 ms
79,088 KB
testcase_06 AC 86 ms
77,408 KB
testcase_07 WA -
testcase_08 AC 3,633 ms
260,272 KB
testcase_09 AC 2,447 ms
260,184 KB
testcase_10 AC 2,812 ms
259,924 KB
testcase_11 AC 3,709 ms
260,040 KB
testcase_12 WA -
testcase_13 AC 73 ms
76,352 KB
testcase_14 AC 2,876 ms
260,208 KB
testcase_15 AC 3,790 ms
260,084 KB
testcase_16 AC 87 ms
78,344 KB
testcase_17 AC 974 ms
260,136 KB
testcase_18 WA -
testcase_19 AC 538 ms
182,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

print(sum(dp))
0