QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#731073 | #9541. Expanding Array | zxcdxw | WA | 0ms | 3832kb | C++14 | 850b | 2024-11-09 23:31:42 | 2024-11-09 23:31:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define lowbit(x) (x)&(-x)
//#define int long long
//#define double long double
const int N = 1e6 + 5;
const ll base = 131;
const ll mod = 998244353;
void solve() {
int n;
cin>>n;
vector<int>a(n+1);
for(int i=1;i<=n;++i) cin>>a[i];
set<int>s;
for(int i=1;i<n;++i){
s.insert(a[i]);
s.insert(a[i+1]);
s.insert((a[i]^a[i+1])&(a[i]&a[i+1]));
s.insert(a[i]^a[i+1]);
s.insert(a[i+1]&(a[i]^a[i+1]));
s.insert((a[i]|a[i+1])^a[i+1]);
s.insert(a[i]^a[i+1]);
s.insert(a[i]|a[i+1]);
}
cout<<s.size()<<'\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t = 1;
//cin >> t;
while (t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3804kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3552kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'