結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー 双六双六
提出日時 2020-07-27 02:34:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 77,480 KB
最終ジャッジ日時 2023-09-11 05:35:18
合計ジャッジ時間 3,844 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,804 KB
testcase_01 AC 98 ms
71,336 KB
testcase_02 AC 104 ms
71,580 KB
testcase_03 AC 99 ms
71,560 KB
testcase_04 AC 98 ms
71,544 KB
testcase_05 AC 97 ms
71,488 KB
testcase_06 AC 99 ms
71,552 KB
testcase_07 AC 111 ms
77,380 KB
testcase_08 AC 109 ms
77,468 KB
testcase_09 AC 108 ms
77,424 KB
testcase_10 AC 109 ms
77,340 KB
testcase_11 AC 109 ms
77,432 KB
testcase_12 AC 99 ms
71,540 KB
testcase_13 AC 101 ms
71,756 KB
testcase_14 AC 105 ms
77,296 KB
testcase_15 AC 107 ms
77,480 KB
testcase_16 AC 101 ms
71,756 KB
testcase_17 AC 106 ms
77,312 KB
testcase_18 AC 108 ms
77,384 KB
testcase_19 AC 105 ms
76,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	A = getlist()
	bases = []
	for i in range(N):
		a = A[i]
		for x in bases:
			a = min(a, a ^ x)
		if a != 0:
			bases.append(a)

	ans = 2 ** (len(bases))
	print(ans)

if __name__ == '__main__':
	main()
0