QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#765328 | #9541. Expanding Array | yuanruiqi# | WA | 0ms | 3640kb | C++14 | 1.0kb | 2024-11-20 13:54:08 | 2024-11-20 13:54:08 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
constexpr int maxn = 100000 + 10;
int a[maxn];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
for (int i=1;i<=n;++i) cin >> a[i];
set<int> s {a[1]};
for (int i=2;i<=n;++i)
{
s.insert(a[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 - 1]) ^ a[i]);
s.insert((a[i] | a[i - 1]) ^ a[i - 1]);
s.insert((a[i] | a[i - 1]) & a[i]);
s.insert((a[i] | a[i - 1]) & a[i - 1]);
s.insert((a[i] & a[i - 1]) ^ a[i]);
s.insert((a[i] & a[i - 1]) ^ a[i - 1]);
s.insert((a[i] & a[i - 1]) | a[i]);
s.insert((a[i] & a[i - 1]) | a[i - 1]);
s.insert((a[i] ^ a[i - 1]) | a[i]);
s.insert((a[i] ^ a[i - 1]) | a[i - 1]);
s.insert((a[i] ^ a[i - 1]) & a[i]);
s.insert((a[i] ^ a[i - 1]) & a[i - 1]);
}
cout << s.size() << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3560kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'