QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#784209 | #9541. Expanding Array | Magical_Kingdom# | WA | 0ms | 3628kb | C++17 | 777b | 2024-11-26 14:06:26 | 2024-11-26 14:06:28 |
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(y | (x ^ y));
s.insert(x & (x ^ y));
s.insert(y & (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;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3620kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3628kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'