結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー shotoyooshotoyoo
提出日時 2021-06-25 00:42:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 5,000 ms
コード長 1,223 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 93,940 KB
最終ジャッジ日時 2023-09-07 13:31:54
合計ジャッジ時間 7,472 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,460 KB
testcase_01 AC 63 ms
71,316 KB
testcase_02 AC 66 ms
71,476 KB
testcase_03 AC 68 ms
71,056 KB
testcase_04 AC 69 ms
71,392 KB
testcase_05 AC 66 ms
71,324 KB
testcase_06 AC 66 ms
71,060 KB
testcase_07 AC 70 ms
71,388 KB
testcase_08 AC 134 ms
87,852 KB
testcase_09 AC 84 ms
76,912 KB
testcase_10 AC 119 ms
85,308 KB
testcase_11 AC 103 ms
81,464 KB
testcase_12 AC 142 ms
91,384 KB
testcase_13 AC 148 ms
91,696 KB
testcase_14 AC 113 ms
84,380 KB
testcase_15 AC 153 ms
93,904 KB
testcase_16 AC 143 ms
89,924 KB
testcase_17 AC 142 ms
91,468 KB
testcase_18 AC 67 ms
75,432 KB
testcase_19 AC 67 ms
71,084 KB
testcase_20 AC 82 ms
88,932 KB
testcase_21 AC 156 ms
93,788 KB
testcase_22 AC 153 ms
93,536 KB
testcase_23 AC 68 ms
71,460 KB
testcase_24 AC 68 ms
71,540 KB
testcase_25 AC 66 ms
71,512 KB
testcase_26 AC 63 ms
71,420 KB
testcase_27 AC 63 ms
71,324 KB
testcase_28 AC 121 ms
86,456 KB
testcase_29 AC 143 ms
91,424 KB
testcase_30 AC 132 ms
89,748 KB
testcase_31 AC 124 ms
88,000 KB
testcase_32 AC 136 ms
90,120 KB
testcase_33 AC 153 ms
93,940 KB
testcase_34 AC 153 ms
93,912 KB
testcase_35 AC 154 ms
93,612 KB
testcase_36 AC 158 ms
93,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))

class BaseF2:
    def  __init__(self, vs=None):
        """vs: list of vecotr in F2
        """
        self.base = []
        if vs is not None:
            for v in vs:
                tmp = v
                for u in self.base:
                    tmp = min(tmp, tmp^u)
                if tmp>0:
                    self.base.append(tmp)
    def dim(self):
        return len(self.base)
    def insert(self, v):
        # 次元が上がったかを返す
        for u in self.base:
            v = min(v, v^u)
            if v==0:
                return False
        self.base.append(v)
        return True
    def check(self, v):
        res = [] # vの作り方
        for u in self.base:
            nv = min(v, v^u)
            if nv<v:
                res.append(u)
                v = nv                    
        return v==0 #, res
    def clear(self):
        self.base = []
n = int(input())
a = list(map(int, input().split()))
base = BaseF2(a)
ans = pow(2, base.dim())
print(ans)
0