QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#774494 | #9541. Expanding Array | chenjue# | WA | 0ms | 3808kb | C++14 | 668b | 2024-11-23 13:20:42 | 2024-11-23 13:20:43 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+10;
void solve(){
int n; cin >> n;
int a[n + 1];
set<int> s;
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]);
s.insert(a[i + 1]);
s.insert(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 + 1]|(a[i]^a[i+1]));
s.insert((a[i]^a[i + 1])|a[i+1]);
}
s.insert(0);
// for(auto i : s){
// cout << i << " ";
// }
cout << s.size();
}
signed main(){
int _=1;
// cin>>_;
while(_--)solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3808kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'