QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#756442#9541. Expanding ArrayStelorWA 0ms3620kbC++17620b2024-11-16 20:29:512024-11-16 20:29:51

Judging History

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

  • [2024-11-16 20:29:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3620kb
  • [2024-11-16 20:29:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;

void solve(){
    int n;
    cin >> n;
    vector<int> a(n+1);
    set<int> s;
    for(int i=1;i<=n;++i) cin >> a[i];
    for(int i=2;i<=n;++i){
        int l=a[i-1],r=a[i];
        s.insert(l);
        s.insert(r);
        s.insert(l|r);
        s.insert(l&r);
        s.insert(l^r);
        s.insert(l&(l^r));
        s.insert(r&(l^r));
        s.insert(l|(l^r));
        s.insert(r|(l^r));
    }
    cout<<s.size();
      
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3620kb

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: 3612kb

input:

2
3 5

output:

7

result:

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