QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#784209#9541. Expanding ArrayMagical_Kingdom#WA 0ms3628kbC++17777b2024-11-26 14:06:262024-11-26 14:06:28

Judging History

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

  • [2024-11-26 14:06:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2024-11-26 14:06:26]
  • 提交

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(y | (x ^ y));

        s.insert(x & (x ^ y));
        s.insert(y & (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;
}

详细

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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