QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#765328#9541. Expanding Arrayyuanruiqi#WA 0ms3640kbC++141.0kb2024-11-20 13:54:082024-11-20 13:54:08

Judging History

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

  • [2024-11-20 13:54:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-11-20 13:54:08]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
constexpr int maxn = 100000 + 10;
int a[maxn];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i=1;i<=n;++i) cin >> a[i];
    set<int> s {a[1]};
    for (int i=2;i<=n;++i)
    {
        s.insert(a[i]);
        s.insert(a[i] ^ a[i - 1]);
        s.insert(a[i] | a[i - 1]);
        s.insert(a[i] & a[i - 1]);
        s.insert((a[i] | a[i - 1]) ^ a[i]);
        s.insert((a[i] | a[i - 1]) ^ a[i - 1]);
        s.insert((a[i] | a[i - 1]) & a[i]);
        s.insert((a[i] | a[i - 1]) & a[i - 1]);
        s.insert((a[i] & a[i - 1]) ^ a[i]);
        s.insert((a[i] & a[i - 1]) ^ a[i - 1]);
        s.insert((a[i] & a[i - 1]) | a[i]);
        s.insert((a[i] & a[i - 1]) | a[i - 1]);
        s.insert((a[i] ^ a[i - 1]) | a[i]);
        s.insert((a[i] ^ a[i - 1]) | a[i - 1]);
        s.insert((a[i] ^ a[i - 1]) & a[i]);
        s.insert((a[i] ^ a[i - 1]) & a[i - 1]);
    }
    cout << s.size() << '\n';
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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