QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#784170#9541. Expanding ArrayMagical_Kingdom#WA 0ms3708kbC++17643b2024-11-26 13:54:112024-11-26 13:54:14

Judging History

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

  • [2024-11-26 13:54:14]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2024-11-26 13:54:11]
  • 提交

answer

#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
const int maxn = 1e5 + 7;
ll n, a[maxn];
set<ll> s;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        s.insert(a[i]);
    }
    for (int i = 1; i < n; i++) {
        ll x = a[i], y = a[i + 1];
        s.insert(x | y);
        s.insert(x & y);
        s.insert(x ^ y);
        s.insert(x | (x ^ y));
        s.insert(x & (x ^ y));
        s.insert(y | (x ^ y));
        s.insert(y & (x ^ y));
    }
    cout << s.size();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

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'