QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#797610 | #9541. Expanding Array | ucup-team191# | WA | 1ms | 4116kb | C++23 | 1.1kb | 2024-12-03 14:51:53 | 2024-12-03 14:51:54 |
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;
for(int i = 0;i < n;i++) {
scanf("%d", A + i);
svi.PB(A[i]);
if(i) {
svi.PB(A[i - 1] ^ A[i]);
svi.PB(A[i - 1] | A[i]);
svi.PB(A[i - 1] & A[i]);
svi.PB((A[i - 1] ^ A[i]) & A[i - 1]);
svi.PB((A[i - 1] ^ A[i]) & A[i]);
svi.PB((A[i - 1] ^ A[i]) | A[i - 1]);
svi.PB((A[i - 1] ^ A[i]) | A[i]);
svi.PB((A[i - 1] | A[i]) ^ A[i - 1]);
svi.PB((A[i - 1] | A[i]) ^ A[i]);
svi.PB((A[i - 1] | A[i]) & A[i - 1]);
svi.PB((A[i - 1] | A[i]) & A[i]);
svi.PB((A[i - 1] & A[i]) ^ A[i - 1]);
svi.PB((A[i - 1] & A[i]) ^ A[i]);
svi.PB((A[i - 1] & A[i]) | A[i - 1]);
svi.PB((A[i - 1] & A[i]) | A[i]);
}
}
sort(svi.begin(), svi.end());
svi.erase(unique(svi.begin(), svi.end()), svi.end());
printf("%d\n", (int)svi.size());
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3824kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 4116kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'