結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー ttrttr
提出日時 2020-02-01 19:08:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,783 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 965 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 77,100 KB
最終ジャッジ日時 2023-09-15 22:29:10
合計ジャッジ時間 18,712 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
76,372 KB
testcase_01 AC 81 ms
76,540 KB
testcase_02 AC 84 ms
76,440 KB
testcase_03 AC 84 ms
76,428 KB
testcase_04 AC 82 ms
76,352 KB
testcase_05 AC 85 ms
76,468 KB
testcase_06 AC 81 ms
76,256 KB
testcase_07 AC 2,783 ms
77,004 KB
testcase_08 AC 1,834 ms
77,052 KB
testcase_09 AC 1,287 ms
77,028 KB
testcase_10 AC 1,527 ms
77,080 KB
testcase_11 AC 2,040 ms
77,080 KB
testcase_12 AC 99 ms
76,464 KB
testcase_13 AC 80 ms
76,248 KB
testcase_14 AC 830 ms
77,100 KB
testcase_15 AC 2,065 ms
76,768 KB
testcase_16 AC 83 ms
76,468 KB
testcase_17 AC 517 ms
76,884 KB
testcase_18 AC 2,295 ms
76,888 KB
testcase_19 AC 304 ms
76,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(a) for a in input().split()]

M = 2**15
dp = [[False]*2 for _ in range(M)]
dp[0][0] = True
for i in range(N):
    for j in range(M):
        if dp[j][i%2]:
            dp[j][(i+1)%2] = True
            dp[j^A[i]][(i+1)%2] = True

ans = 0
for i in range(M):
    if dp[i][N%2]:
        ans += 1
print(ans)
0