QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#738770#9541. Expanding Arrayzheng_zijianWA 0ms3856kbC++20485b2024-11-12 19:53:252024-11-12 19:53:26

Judging History

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

  • [2024-11-12 19:53:26]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3856kb
  • [2024-11-12 19:53:25]
  • 提交

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);
        las = now;
    }
    printf("%llu\n",st.size());
}
int main()
{
    solve();
    return 0;
}

詳細信息

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

6

result:

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