QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#784170 | #9541. Expanding Array | Magical_Kingdom# | WA | 0ms | 3708kb | C++17 | 643b | 2024-11-26 13:54:11 | 2024-11-26 13:54:14 |
Judging History
answer
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
const int maxn = 1e5 + 7;
ll n, a[maxn];
set<ll> s;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
s.insert(a[i]);
}
for (int i = 1; i < n; i++) {
ll x = a[i], y = a[i + 1];
s.insert(x | y);
s.insert(x & y);
s.insert(x ^ y);
s.insert(x | (x ^ y));
s.insert(x & (x ^ y));
s.insert(y | (x ^ y));
s.insert(y & (x ^ y));
}
cout << s.size();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3616kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3708kb
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'