QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#745577 | #9541. Expanding Array | KDream | WA | 1ms | 3856kb | C++20 | 680b | 2024-11-14 10:39:04 | 2024-11-14 10:39:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void _Z()
{
int n;
cin >> n;
vector<int> a(n);
map<int,int> s;
for (int i = 0;i < n;i ++)
{
cin >> a[i];
s[a[i]] = 1;
}
s[0] = 1;
for (int i = 1;i < n;i ++)
{
int x = a[i] ^ a[i - 1];
s[x] = 1;
s[x | a[i]] = 1;
s[x & a[i]] = 1;
s[x | a[i - 1]] = 1;
s[x & a[i - 1]] = 1;
}
cout << s.size() << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
//cin >> t;
while (t--)
{
_Z();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3780kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3856kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'