結果
| 問題 | No.184 たのしい排他的論理和(HARD) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-18 21:04:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 118 ms / 5,000 ms |
| コード長 | 340 bytes |
| 記録 | |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 93,824 KB |
| 最終ジャッジ日時 | 2026-05-18 21:04:36 |
| 合計ジャッジ時間 | 4,067 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
b=[0]*n;ans=0
for i in range(60,-1,-1):
x=1<<i;q=-1
for j in range(n):
if b[j]:
continue
if a[j]&x:
q=j;break
if q<0:
continue
b[q]=1;ans+=1
for j in range(n):
if a[j]&x and j!=q:
a[j]^=a[q]
print(1<<ans)