QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#731073#9541. Expanding ArrayzxcdxwWA 0ms3832kbC++14850b2024-11-09 23:31:422024-11-09 23:31:42

Judging History

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

  • [2024-11-09 23:31:42]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3832kb
  • [2024-11-09 23:31:42]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

#define ull unsigned long long
#define ll long long
#define lowbit(x) (x)&(-x)
//#define int long long
//#define double long double 
const int N = 1e6 + 5;
const ll base = 131;
const ll mod = 998244353;

void solve() {
    int n;
    cin>>n;
    vector<int>a(n+1);
    for(int i=1;i<=n;++i) cin>>a[i];
    set<int>s;
    for(int i=1;i<n;++i){
        s.insert(a[i]);
        s.insert(a[i+1]);
        s.insert((a[i]^a[i+1])&(a[i]&a[i+1]));
        s.insert(a[i]^a[i+1]);
        s.insert(a[i+1]&(a[i]^a[i+1]));
        s.insert((a[i]|a[i+1])^a[i+1]);
        s.insert(a[i]^a[i+1]);
        s.insert(a[i]|a[i+1]);
    }
    cout<<s.size()<<'\n';
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
    //cin >> t;
    while (t--) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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