結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー vwxyzvwxyz
提出日時 2021-09-12 15:30:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 321 ms / 5,000 ms
コード長 1,031 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 110,212 KB
最終ジャッジ日時 2023-09-06 10:49:37
合計ジャッジ時間 13,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 207 ms
91,204 KB
testcase_01 AC 208 ms
91,456 KB
testcase_02 AC 203 ms
91,276 KB
testcase_03 AC 203 ms
91,056 KB
testcase_04 AC 208 ms
91,348 KB
testcase_05 AC 207 ms
91,252 KB
testcase_06 AC 215 ms
91,280 KB
testcase_07 AC 213 ms
91,136 KB
testcase_08 AC 306 ms
105,000 KB
testcase_09 AC 231 ms
94,932 KB
testcase_10 AC 251 ms
102,224 KB
testcase_11 AC 239 ms
99,060 KB
testcase_12 AC 281 ms
108,088 KB
testcase_13 AC 294 ms
107,904 KB
testcase_14 AC 269 ms
101,876 KB
testcase_15 AC 319 ms
109,860 KB
testcase_16 AC 284 ms
106,788 KB
testcase_17 AC 290 ms
107,724 KB
testcase_18 AC 215 ms
91,792 KB
testcase_19 AC 212 ms
91,600 KB
testcase_20 AC 233 ms
106,976 KB
testcase_21 AC 296 ms
110,024 KB
testcase_22 AC 304 ms
109,812 KB
testcase_23 AC 209 ms
91,496 KB
testcase_24 AC 208 ms
91,376 KB
testcase_25 AC 207 ms
91,344 KB
testcase_26 AC 217 ms
91,220 KB
testcase_27 AC 210 ms
91,556 KB
testcase_28 AC 267 ms
103,424 KB
testcase_29 AC 287 ms
108,048 KB
testcase_30 AC 281 ms
106,404 KB
testcase_31 AC 285 ms
104,716 KB
testcase_32 AC 277 ms
106,220 KB
testcase_33 AC 320 ms
109,916 KB
testcase_34 AC 305 ms
110,212 KB
testcase_35 AC 308 ms
109,640 KB
testcase_36 AC 321 ms
109,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

def XOR_Basis(lst):
    xor_basis=[]
    triangulation=[]
    for x in lst:
        xx=x
        for xb in triangulation:
            xx=min(xx,xx^xb)
        if xx:
            xor_basis.append(x)
            triangulation.append(xx)
    return xor_basis,triangulation

N=int(readline())
A=list(map(int,readline().split()))
_,tria=XOR_Basis(A)
ans=pow(2,len(tria))
print(ans)
0