QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#732590 | #9541. Expanding Array | ucup-team1412# | WA | 0ms | 3608kb | C++23 | 769b | 2024-11-10 15:15:29 | 2024-11-10 15:15:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int a[100000 + 5];
unordered_map<int, bool> MAP;
int main()
{
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
MAP[a[i]] = true;
}
// cout << MAP.size();
for (int i = 1; i < n; i++)
{
int x = a[i], y = a[i + 1];
int res;
res = x & y;
MAP[res] = 1;
res = x | y;
MAP[res] = 1;
res = x ^ y;
MAP[res] = 1;
res = x ^ (x | y);
MAP[res] = 1;
res = y ^ (x | y);
MAP[res] = 1;
res = y & (x ^ y);
MAP[res] = 1;
res = x & (x ^ y);
MAP[res] = 1;
}
cout << MAP.size();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'