QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#787878 | #9541. Expanding Array | huan_yp# | WA | 0ms | 3664kb | C++17 | 457b | 2024-11-27 15:05:56 | 2024-11-27 15:05:59 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=5e5+10;
int a[N];
set<int> st;
void add(int x, int y){
st.insert(x&(x^y));
}
int main(){
int n;
cin>>n;
st.insert(0);
for(int i=1;i<=n;i++)cin>>a[i], st.insert(a[i]);
for(int i=1;i<n;i++){
add(a[i], a[i+1]);
add(a[i+1], a[i]);
st.insert(a[i]^a[i+1]);
st.insert(a[i]|a[i+1]);
}
cout<<st.size()<<'\n';
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: 3664kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3528kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'