QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#770454#9541. Expanding ArrayJEdwardWA 0ms3600kbC++20517b2024-11-21 21:57:492024-11-21 21:57:50

Judging History

你现在查看的是最新测评结果

  • [2024-11-21 21:57:50]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3600kb
  • [2024-11-21 21:57:49]
  • 提交

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;
}

詳細信息

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'