QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#726149#9541. Expanding ArrayArkhellWA 1ms3548kbC++14550b2024-11-08 21:57:022024-11-08 21:57:03

Judging History

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

  • [2024-11-08 21:57:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3548kb
  • [2024-11-08 21:57:02]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long 
using namespace std;
void solve(){
    map<int,int>mp;
    int n;
    cin>>n;
    mp[0]=1;
    int pre;
    cin>>pre;
    mp[pre]=1;
    for(int i=2;i<=n;i++){
        int x;
        cin>>x;
        int a=x&pre;
        int b=x|pre;
        int c=x^pre;
        mp[x]=1;
        mp[a]=1;
        mp[b]=1;
        mp[c]=1;
        
        pre=x;

    }
    cout<<mp.size();
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3536kb

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3548kb

input:

2
3 5

output:

6

result:

wrong answer 1st lines differ - expected: '8', found: '6'