結果
| 問題 | No.184 たのしい排他的論理和(HARD) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-21 01:12:00 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 35 ms / 5,000 ms |
| + 958µs | |
| コード長 | 766 bytes |
| 記録 | |
| コンパイル時間 | 366 ms |
| コンパイル使用メモリ | 73,868 KB |
| 実行使用メモリ | 8,240 KB |
| 最終ジャッジ日時 | 2026-10-21 01:12:27 |
| 合計ジャッジ時間 | 5,458 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
const int N = 100010, B = 70;
LL a[N];
int n, rnk;
struct LinearBasis {
LL v[B];
void Insert(LL x) {
for (int i = B - 1; i >= 0; --i) {
if (x >> i & 1) {
if (v[i]) {
x ^= v[i];
} else {
v[i] = x;
++rnk;
return;
}
}
}
}
};
LinearBasis lb;
int main() {
// freopen("int.in", "r", stdin);
// freopen("int.out", "w", stdout);
scanf("%d", &n);
for (int i = 1; i <= n; ++i) {
scanf("%lld", &a[i]);
lb.Insert(a[i]);
}
printf("%lld\n", 1LL << rnk);
return 0;
}