結果
問題 | No.184 たのしい排他的論理和(HARD) |
ユーザー |
|
提出日時 | 2023-10-08 17:53:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 22,032 KB |
最終ジャッジ日時 | 2024-07-26 18:10:06 |
合計ジャッジ時間 | 21,343 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 RE * 1 |
ソースコード
def gauss_jordan(A):# F2 上の Gauss Jordan の掃き出し法# 基底を取り出す# 引数を破壊的に変更するidx = 0for i in range(59, -1, -1):for j, a in enumerate(A[idx:], idx):if a>>i & 1:breakelse:continueA[idx], A[j] = A[j], A[idx]for j in range(len(A)):if j != idx and A[j]>>i & 1:A[j] ^= aidx += 1assert not any(A[idx:])del A[idx:]import sysinput = sys.stdin.readlinen = int(input())A = list(map(int, input().split()))gauss_jordan(A)print(pow(2, len(A)))