QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#797604 | #9541. Expanding Array | ucup-team191# | WA | 0ms | 4104kb | C++23 | 546b | 2024-12-03 14:44:26 | 2024-12-03 14:44:26 |
Judging History
answer
#include <bits/stdc++.h>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int N = 3e5 + 500;
int A[N];
int main() {
set < int > S;
int n; scanf("%d", &n);
vi svi = {0};
for(int i = 0;i < n;i++) {
scanf("%d", A + i);
svi.PB(A[i]);
if(i) svi.PB(A[i - 1] ^ A[i]);
}
sort(svi.begin(), svi.end());
svi.erase(unique(svi.begin(), svi.end()), svi.end());
printf("%d\n", (int)svi.size());
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3900kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 4104kb
input:
2 3 5
output:
4
result:
wrong answer 1st lines differ - expected: '8', found: '4'