QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#767217#9541. Expanding Arrayyld#WA 0ms3656kbC++20579b2024-11-20 20:14:072024-11-20 20:14:12

Judging History

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

  • [2024-11-20 20:14:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3656kb
  • [2024-11-20 20:14:07]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
void solve()
{   
    int n;
    cin>>n;
    vector<int> a(n+1);
    set<int> s;
    for(int i=1;i<=n;i++) cin>>a[i],s.insert(a[i]);
    for(int i=1;i<n;i++)
    {
        int A=a[i]&a[i+1];
        s.insert(A);
        s.insert(a[i]|a[i+1]);
        s.insert(a[i]^a[i+1]);
        s.insert(A^a[i]);
        s.insert(A^a[i+1]);
    }
    cout<<s.size()<<endl;
}
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t=1;
    while(t--) solve();
    return 0;
}

详细

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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