QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#724461 | #9541. Expanding Array | ucup-team1001# | WA | 0ms | 3824kb | C++23 | 1.3kb | 2024-11-08 13:15:06 | 2024-11-08 13:15:07 |
Judging History
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'