QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#779152#9541. Expanding ArrayoumashuWA 3ms18028kbC++17796b2024-11-24 17:41:002024-11-24 17:41:01

Judging History

你现在查看的是最新测评结果

  • [2024-11-24 17:41:01]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:18028kb
  • [2024-11-24 17:41:00]
  • 提交

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'