結果
問題 |
No.184 たのしい排他的論理和(HARD)
|
ユーザー |
👑 ![]() |
提出日時 | 2025-10-05 05:15:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 149 ms / 5,000 ms |
コード長 | 776 bytes |
コンパイル時間 | 552 ms |
コンパイル使用メモリ | 82,776 KB |
実行使用メモリ | 93,640 KB |
最終ジャッジ日時 | 2025-10-05 05:16:03 |
合計ジャッジ時間 | 7,647 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
""" https://yukicoder.me/problems/no/184 基底 """ def xor_base(lis): base = [] for na in lis: for e in base: na = min(na , e^na) if na > 0: base.append(na) for i in range(len(base)-1,-1,-1): for j in range(i+1,len(base)): if base[i] ^ base[j] < base[i]: base[i] ^= base[j] return base def construct_able(x,base): ret = [] for i,b in enumerate(base): nbit = 2**(b.bit_length()-1) if nbit & x > 0: x ^= b ret.append(i) if x == 0: return True,ret else: return False,None from collections import deque N = int(input()) A = list(map(int,input().split())) base = xor_base(A) print (2**len(base))