QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#770454 | #9541. Expanding Array | JEdward | WA | 0ms | 3600kb | C++20 | 517b | 2024-11-21 21:57:49 | 2024-11-21 21:57:50 |
Judging History
answer
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector<int> basis;
for (int num : a) {
for (int b : basis) {
num = min(num, num ^ b);
}
if (num != 0) {
basis.push_back(num);
}
}
int k = basis.size();
int answer = 1 << k;
cout << answer << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3560kb
input:
2 3 5
output:
4
result:
wrong answer 1st lines differ - expected: '8', found: '4'