QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#738763#9541. Expanding Arrayzheng_zijianWA 0ms3796kbC++20465b2024-11-12 19:52:332024-11-12 19:52:38

Judging History

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

  • [2024-11-12 19:52:38]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3796kb
  • [2024-11-12 19:52:33]
  • 提交

answer

#include <cstdio>
#include <set>

using namespace std;
void solve()
{
    int n, las,now;
    set<int> st;
    st.insert(0);
    scanf("%d",&n);
    scanf("%d",&las);
    st.insert(las);
    for (int i = 2;i <= n;++i){
        scanf("%d",&now);
        st.insert(now);
        st.insert(now | las);
        st.insert(now & las);
        st.insert(now ^ las);
    }
    printf("%llu\n",st.size());
}
int main()
{
    solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

6

result:

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