QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#725657 | #9541. Expanding Array | maxiaomeng | WA | 1ms | 3652kb | C++14 | 447b | 2024-11-08 19:13:43 | 2024-11-08 19:13:44 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N=500005;
int n,a[N];
set<int>s;
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<n;i++)s.insert(a[i]&a[i+1]),s.insert(a[i]|a[i+1]),s.insert(a[i]^a[i+1]),s.insert(a[i]&(a[i]^a[i+1])),s.insert(a[i+1]&(a[i]^a[i+1]));
cout<<s.size();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3652kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3520kb
input:
2 3 5
output:
5
result:
wrong answer 1st lines differ - expected: '8', found: '5'