結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー maspymaspy
提出日時 2020-03-03 15:49:57
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 211 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 38,324 KB
最終ジャッジ日時 2023-09-17 18:11:08
合計ジャッジ時間 10,151 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
29,680 KB
testcase_01 AC 131 ms
29,712 KB
testcase_02 AC 132 ms
29,780 KB
testcase_03 AC 133 ms
29,684 KB
testcase_04 AC 132 ms
29,684 KB
testcase_05 AC 133 ms
29,796 KB
testcase_06 AC 131 ms
29,616 KB
testcase_07 AC 131 ms
29,632 KB
testcase_08 AC 198 ms
35,628 KB
testcase_09 AC 142 ms
31,060 KB
testcase_10 AC 177 ms
34,084 KB
testcase_11 AC 162 ms
32,768 KB
testcase_12 AC 195 ms
36,880 KB
testcase_13 AC 201 ms
37,296 KB
testcase_14 AC 170 ms
33,976 KB
testcase_15 AC 208 ms
37,800 KB
testcase_16 AC 194 ms
36,620 KB
testcase_17 AC 199 ms
37,172 KB
testcase_18 AC 131 ms
29,728 KB
testcase_19 AC 130 ms
29,724 KB
testcase_20 AC 152 ms
32,412 KB
testcase_21 AC 211 ms
38,300 KB
testcase_22 AC 208 ms
38,324 KB
testcase_23 AC 130 ms
29,660 KB
testcase_24 AC 132 ms
29,800 KB
testcase_25 AC 130 ms
29,728 KB
testcase_26 AC 131 ms
29,716 KB
testcase_27 AC 132 ms
29,632 KB
testcase_28 AC 178 ms
34,724 KB
testcase_29 AC 196 ms
36,960 KB
testcase_30 AC 187 ms
36,268 KB
testcase_31 AC 180 ms
35,124 KB
testcase_32 AC 193 ms
36,672 KB
testcase_33 AC 207 ms
37,784 KB
testcase_34 AC 210 ms
38,032 KB
testcase_35 AC 211 ms
38,300 KB
testcase_36 AC 209 ms
38,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


# %%
import numpy as np

# %%


def row_transform_over_F2(A, highest=60):
    for k in range(highest, -1, -1):
        I = np.where((A >> k) == 1)[0]
        if len(I) == 0:
            continue
        i = I[0]
        x = A[i]
        A ^= ((A >> k) & 1) * x
        A[i] = x


# %%
N = int(readline())
A = np.array(read().split(), np.int64)


# %%
row_transform_over_F2(A, highest=61)


# %%
dim = np.count_nonzero(A)
print(2 ** dim)
0