QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#732496 | #9541. Expanding Array | XiaoretaW# | WA | 0ms | 3792kb | C++20 | 990b | 2024-11-10 14:51:20 | 2024-11-10 14:51:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define vi vector<int>
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define per(i,b,a) for(int i = b-;1 i >= a; --i)
int main(){
ios::sync_with_stdio(0); cin.tie(0);
// rep(a,20,30) rep(b,40,50) {
// int c1 = a ^ b | b;
// int c2 = a ^ b;
// cout << c1 << ' ' << c2 << ' ' << a << ' ' << b << '\n';
// // assert(c1 == c2);
// }
int n; cin >> n;
vector<ll> a(n); rep(i,0,n) cin >> a[i];
set<ll> st;
rep(i,0,n-1){
st.insert(a[i]);
st.insert(a[i+1]);
st.insert(0);
st.insert(a[i] & a[i+1]);
st.insert(a[i] | a[i+1]);
st.insert(a[i] ^ a[i+1]);
st.insert(a[i] ^ a[i+1] | a[i+1]);
st.insert(a[i] ^ a[i+1] | a[i]);
}
cout << st.size() << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3648kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3772kb
input:
2 3 5
output:
6
result:
wrong answer 1st lines differ - expected: '8', found: '6'