QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#733018#9541. Expanding ArrayRWeakest#WA 0ms3652kbC++17590b2024-11-10 16:52:072024-11-10 16:52:08

Judging History

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

  • [2024-11-10 16:52:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-11-10 16:52:07]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;
#define ll long long

const int N = 1e5 + 100;

ll T, n;
ll a[N];
set<ll> s;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr), std::cout.tie(nullptr);

    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) s.insert(a[i]);
    for (int i = 1; i <= n - 1; i++) {
        ll a1 = a[i], a2 = a[i + 1];
        s.insert(a1 & a2);
        s.insert(a1 ^ a2);
        s.insert(a1 | a2);
        s.insert(0);
    }

    cout << s.size();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

6

result:

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