結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー gorugo30gorugo30
提出日時 2021-03-16 23:23:17
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 2,076 ms / 5,000 ms
コード長 262 bytes
コンパイル時間 882 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 77,116 KB
最終ジャッジ日時 2023-08-08 13:36:41
合計ジャッジ時間 16,574 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,120 KB
testcase_01 AC 79 ms
76,116 KB
testcase_02 AC 84 ms
76,248 KB
testcase_03 AC 80 ms
76,160 KB
testcase_04 AC 78 ms
75,920 KB
testcase_05 AC 83 ms
76,252 KB
testcase_06 AC 79 ms
76,412 KB
testcase_07 AC 2,076 ms
76,684 KB
testcase_08 AC 1,724 ms
77,116 KB
testcase_09 AC 1,205 ms
76,896 KB
testcase_10 AC 1,435 ms
76,900 KB
testcase_11 AC 1,862 ms
76,684 KB
testcase_12 AC 83 ms
76,372 KB
testcase_13 AC 73 ms
75,636 KB
testcase_14 AC 1,498 ms
76,592 KB
testcase_15 AC 1,929 ms
76,880 KB
testcase_16 AC 82 ms
76,328 KB
testcase_17 AC 490 ms
76,672 KB
testcase_18 AC 1,860 ms
76,728 KB
testcase_19 AC 291 ms
76,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
dp = [False] * (2 ** 15)
A = list(map(int, input().split()))
dp[0] = True
dp[A[0]] = True
for i in range(1, N):
    for j in range(2 ** 15):
        dp[j ^ A[i]] |= dp[j]
ans = 0
for i in range(2 ** 15):
    if dp[i]:
        ans += 1
print(ans)
0