QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#787878#9541. Expanding Arrayhuan_yp#WA 0ms3664kbC++17457b2024-11-27 15:05:562024-11-27 15:05:59

Judging History

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

  • [2024-11-27 15:05:59]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3664kb
  • [2024-11-27 15:05:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=5e5+10;
int a[N];
set<int> st;
void add(int x, int y){
    st.insert(x&(x^y));
}
int main(){
    int n;
    cin>>n;
    st.insert(0);
    for(int i=1;i<=n;i++)cin>>a[i], st.insert(a[i]);
    for(int i=1;i<n;i++){
        add(a[i], a[i+1]);
        add(a[i+1], a[i]);
        st.insert(a[i]^a[i+1]);
        st.insert(a[i]|a[i+1]);
    }
    cout<<st.size()<<'\n';
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3528kb

input:

2
3 5

output:

7

result:

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