QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#724461#9541. Expanding Arrayucup-team1001#WA 0ms3824kbC++231.3kb2024-11-08 13:15:062024-11-08 13:15:07

Judging History

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

  • [2024-11-08 13:15:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2024-11-08 13:15:06]
  • 提交

answer

/*

Author: Haze

*/

#include <bits/stdc++.h>

#define irep(i, l, r) for(int i = (l); i <= (r); ++ i)
#define drep(i, r, l) for(int i = (r); i >= (l); -- i)
#define IOS ios::sync_with_stdio(false), cin.tie(nullptr);
using namespace std;
typedef long long ll;

inline ll readL() {
    ll s = 0;
    bool fl = false;
    char ch = (char) getchar();
    while (!isdigit(ch)) {
        if (ch == '-')fl = true;
        ch = (char) getchar();
    }
    while (isdigit(ch)) {
        s = s * 10 + (ch ^ 48);
        ch = (char) getchar();
    }
    return fl ? -s : s;
}

inline int read() {
    return (int) (readL());
}

const int mod = 1000000000 + 7;
const int itinf = 1000000999;
const ll llinf = 2e18;
const int N = 500099;

void solve() {
    int n = read();
    vector<int>a(n), num;
    irep(i, 0, n - 1)a[i] = read();
    num = a;
    irep(i, 0, n - 2){
        int x = a[i], y = a[i + 1];
        num.push_back(x ^ y);
        num.push_back(x & y);
        num.push_back(x | y);
        num.push_back(x & (x ^ y));
        num.push_back(y & (x ^ y));
    }
    sort(begin(num), end(num));
    num.erase(unique(begin(num), end(num)), end(num));
    cout << num.size();
}

int main() {
    // IOS
    int T = 1;
    while (T--) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

7

result:

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