QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#779152 | #9541. Expanding Array | oumashu | WA | 3ms | 18028kb | C++17 | 796b | 2024-11-24 17:41:00 | 2024-11-24 17:41:01 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e7;
map<ll,ll>mp;
ll n;
ll a[N],b[N],c[N],d[N],e[N],f[N],g[N],h[N];
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
mp[a[i]]=1;
}
for(int i=1;i<n;i++)
{
b[i]=a[i]|a[i+1];
}
for(int i=1;i<n;i++)
{
c[i]=a[i]&b[i];
d[i]=b[i]&a[i+1];
}
for(int i=1;i<n;i++)
{
e[i]=a[i]^c[i];
f[i]=c[i]^b[i];
g[i]=b[i]^d[i];
h[i]=d[i]^a[i+1];
}
for(int i=1;i<=n-1;i++)
{
mp[b[i]]=1;
mp[c[i]]=1;
mp[d[i]]=1;
mp[e[i]]=1;
mp[f[i]]=1;
mp[g[i]]=1;
mp[h[i]]=1;
}
cout<<mp.size();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 17836kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 18028kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 3ms
memory: 18024kb
input:
2 3 5
output:
6
result:
wrong answer 1st lines differ - expected: '8', found: '6'