QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#774994#9541. Expanding ArrayKafuuChinocpp#WA 0ms3872kbC++14759b2024-11-23 14:26:152024-11-23 14:26:17

Judging History

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

  • [2024-11-23 14:26:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3872kb
  • [2024-11-23 14:26:15]
  • 提交

answer

#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

const int max1 = 1e5;

int n, a[max1 + 5];
vector <int> ans;

int main ()
{
    scanf("%d", &n);
    for ( int i = 1; i <= n; i ++ )
        scanf("%d", &a[i]);
    
    for ( int i = 1; i <= n - 1; i ++ )
    {
        ans.push_back(a[i]);
        ans.push_back(a[i + 1]);
        ans.push_back(a[i] | a[i + 1]);
        ans.push_back(a[i] & a[i + 1]);
        ans.push_back(a[i] ^ a[i + 1]);
        ans.push_back(a[i] ^ (a[i] & a[i + 1]));
        ans.push_back(a[i + 1] ^ (a[i] & a[i + 1]));
    }

    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());

    printf("%lu\n", ans.size());

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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