結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー lloyzlloyz
提出日時 2023-10-08 17:55:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 209 ms / 5,000 ms
コード長 634 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 138,364 KB
最終ジャッジ日時 2023-10-08 17:55:31
合計ジャッジ時間 7,476 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,440 KB
testcase_01 AC 68 ms
71,172 KB
testcase_02 AC 73 ms
75,468 KB
testcase_03 AC 70 ms
71,140 KB
testcase_04 AC 68 ms
71,328 KB
testcase_05 AC 70 ms
71,396 KB
testcase_06 AC 72 ms
71,396 KB
testcase_07 AC 72 ms
75,588 KB
testcase_08 AC 167 ms
121,772 KB
testcase_09 AC 89 ms
76,784 KB
testcase_10 AC 146 ms
110,832 KB
testcase_11 AC 127 ms
100,068 KB
testcase_12 AC 189 ms
130,984 KB
testcase_13 AC 193 ms
120,656 KB
testcase_14 AC 143 ms
109,008 KB
testcase_15 AC 198 ms
123,512 KB
testcase_16 AC 178 ms
128,024 KB
testcase_17 AC 190 ms
119,088 KB
testcase_18 AC 75 ms
75,556 KB
testcase_19 AC 69 ms
71,572 KB
testcase_20 AC 139 ms
138,364 KB
testcase_21 AC 209 ms
127,352 KB
testcase_22 AC 204 ms
127,316 KB
testcase_23 AC 75 ms
75,760 KB
testcase_24 AC 70 ms
71,552 KB
testcase_25 AC 72 ms
75,680 KB
testcase_26 AC 70 ms
71,532 KB
testcase_27 AC 70 ms
71,184 KB
testcase_28 AC 158 ms
115,676 KB
testcase_29 AC 186 ms
118,388 KB
testcase_30 AC 177 ms
110,860 KB
testcase_31 AC 161 ms
100,580 KB
testcase_32 AC 180 ms
106,224 KB
testcase_33 AC 202 ms
123,764 KB
testcase_34 AC 195 ms
123,460 KB
testcase_35 AC 209 ms
127,244 KB
testcase_36 AC 204 ms
126,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gauss_jordan(A):
    # F2 上の Gauss Jordan の掃き出し法
    # 基底を取り出す
    # 引数を破壊的に変更する
    idx = 0
    for i in range(61, -1, -1):
        for j, a in enumerate(A[idx:], idx):
            if a>>i & 1:
                break
        else:
            continue
        A[idx], A[j] = A[j], A[idx]
        for j in range(len(A)):
            if j != idx and A[j]>>i & 1:
                A[j] ^= a
        idx += 1
    assert not any(A[idx:])
    del A[idx:]
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
gauss_jordan(A)
print(pow(2, len(A)))
0