QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#767239#9541. Expanding Arrayyld#WA 0ms3520kbC++20911b2024-11-20 20:19:172024-11-20 20:19:18

Judging History

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

  • [2024-11-20 20:19:18]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3520kb
  • [2024-11-20 20:19:17]
  • 提交

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];
        int B=a[i]|a[i+1];
        int C=a[i]^a[i+1];
        s.insert(A);
        s.insert(B);
        s.insert(C);
        s.insert(A^a[i]);
        s.insert(A^a[i+1]);
        s.insert(A|a[i]);
        s.insert(A|a[i+1]);

        
        s.insert(B&a[i]);
        s.insert(B&a[i+1]);
        s.insert(B^a[i]);
        s.insert(B^a[i+1]);


        s.insert(C&a[i]);
        s.insert(C&a[i+1]);
        s.insert(C|a[i]);
        s.insert(C|a[i+1]);
    }
    cout<<s.size()<<endl;
}
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t=1;
    while(t--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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