QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#732590#9541. Expanding Arrayucup-team1412#WA 0ms3608kbC++23769b2024-11-10 15:15:292024-11-10 15:15:30

Judging History

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

  • [2024-11-10 15:15:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3608kb
  • [2024-11-10 15:15:29]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int a[100000 + 5];
unordered_map<int, bool> MAP;

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        MAP[a[i]] = true;
    }
    // cout << MAP.size();
    for (int i = 1; i < n; i++)
    {
        int x = a[i], y = a[i + 1];
        int res;
        res = x & y;
        MAP[res] = 1;
        res = x | y;
        MAP[res] = 1;
        res = x ^ y;
        MAP[res] = 1;
        res = x ^ (x | y);
        MAP[res] = 1;
        res = y ^ (x | y);
        MAP[res] = 1;
        res = y & (x ^ y);
        MAP[res] = 1;
        res = x & (x ^ y);
        MAP[res] = 1;
    }
    cout << MAP.size();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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