結果
問題 | No.184 たのしい排他的論理和(HARD) |
ユーザー | vwxyz |
提出日時 | 2021-09-12 15:29:54 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 1,291 ms / 5,000 ms |
コード長 | 1,031 bytes |
コンパイル時間 | 243 ms |
コンパイル使用メモリ | 10,760 KB |
実行使用メモリ | 23,076 KB |
最終ジャッジ日時 | 2023-09-06 10:50:32 |
合計ジャッジ時間 | 25,383 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
10,456 KB |
testcase_01 | AC | 29 ms
10,308 KB |
testcase_02 | AC | 31 ms
10,432 KB |
testcase_03 | AC | 30 ms
10,404 KB |
testcase_04 | AC | 30 ms
10,316 KB |
testcase_05 | AC | 31 ms
10,452 KB |
testcase_06 | AC | 34 ms
10,396 KB |
testcase_07 | AC | 31 ms
10,400 KB |
testcase_08 | AC | 910 ms
19,444 KB |
testcase_09 | AC | 211 ms
12,196 KB |
testcase_10 | AC | 721 ms
17,028 KB |
testcase_11 | AC | 496 ms
15,232 KB |
testcase_12 | AC | 1,057 ms
20,972 KB |
testcase_13 | AC | 1,144 ms
21,512 KB |
testcase_14 | AC | 671 ms
16,736 KB |
testcase_15 | AC | 1,289 ms
22,960 KB |
testcase_16 | AC | 1,187 ms
20,772 KB |
testcase_17 | AC | 1,274 ms
21,460 KB |
testcase_18 | AC | 35 ms
10,316 KB |
testcase_19 | AC | 33 ms
10,448 KB |
testcase_20 | AC | 72 ms
12,160 KB |
testcase_21 | AC | 1,291 ms
23,020 KB |
testcase_22 | AC | 1,264 ms
23,076 KB |
testcase_23 | AC | 28 ms
10,440 KB |
testcase_24 | AC | 29 ms
10,308 KB |
testcase_25 | AC | 30 ms
10,396 KB |
testcase_26 | AC | 28 ms
10,408 KB |
testcase_27 | AC | 29 ms
10,328 KB |
testcase_28 | AC | 769 ms
18,164 KB |
testcase_29 | AC | 1,097 ms
21,328 KB |
testcase_30 | AC | 914 ms
20,092 KB |
testcase_31 | AC | 791 ms
18,524 KB |
testcase_32 | AC | 976 ms
20,852 KB |
testcase_33 | AC | 1,228 ms
22,916 KB |
testcase_34 | AC | 1,225 ms
22,496 KB |
testcase_35 | AC | 1,272 ms
23,036 KB |
testcase_36 | AC | 1,245 ms
22,608 KB |
ソースコード
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)