結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー lloyzlloyz
提出日時 2023-10-08 17:53:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 659 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 20,868 KB
最終ジャッジ日時 2023-10-08 17:53:40
合計ジャッジ時間 17,163 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,816 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 15 ms
7,920 KB
testcase_03 AC 16 ms
7,880 KB
testcase_04 AC 14 ms
7,788 KB
testcase_05 AC 14 ms
7,816 KB
testcase_06 AC 14 ms
7,828 KB
testcase_07 AC 14 ms
7,788 KB
testcase_08 AC 595 ms
17,164 KB
testcase_09 AC 134 ms
9,912 KB
testcase_10 AC 454 ms
14,900 KB
testcase_11 AC 330 ms
13,040 KB
testcase_12 AC 690 ms
18,520 KB
testcase_13 AC 749 ms
19,464 KB
testcase_14 AC 435 ms
14,476 KB
testcase_15 AC 808 ms
20,380 KB
testcase_16 AC 682 ms
18,348 KB
testcase_17 AC 731 ms
19,276 KB
testcase_18 RE -
testcase_19 AC 14 ms
7,912 KB
testcase_20 AC 532 ms
9,928 KB
testcase_21 AC 846 ms
20,868 KB
testcase_22 AC 842 ms
20,824 KB
testcase_23 AC 15 ms
7,916 KB
testcase_24 AC 14 ms
7,784 KB
testcase_25 AC 14 ms
7,816 KB
testcase_26 AC 14 ms
7,976 KB
testcase_27 AC 15 ms
7,828 KB
testcase_28 AC 506 ms
15,660 KB
testcase_29 AC 713 ms
19,020 KB
testcase_30 AC 627 ms
17,672 KB
testcase_31 AC 541 ms
16,400 KB
testcase_32 AC 668 ms
18,540 KB
testcase_33 AC 818 ms
20,492 KB
testcase_34 AC 808 ms
20,220 KB
testcase_35 AC 853 ms
20,864 KB
testcase_36 AC 850 ms
20,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gauss_jordan(A):
    # F2 上の Gauss Jordan の掃き出し法
    # 基底を取り出す
    # 引数を破壊的に変更する
    idx = 0
    for i in range(59, -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