結果
| 問題 | No.184 たのしい排他的論理和(HARD) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-08 17:55:23 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 151 ms / 5,000 ms |
| + 127µs | |
| コード長 | 634 bytes |
| 記録 | |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 95,720 KB |
| 実行使用メモリ | 148,744 KB |
| 最終ジャッジ日時 | 2026-08-24 13:45:37 |
| 合計ジャッジ時間 | 7,773 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
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)))