QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#731071 | #9541. Expanding Array | zxcdxw | WA | 0ms | 3540kb | C++14 | 848b | 2024-11-09 23:30:58 | 2024-11-09 23:30:58 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define lowbit(x) (x)&(-x)
//#define int long long
//#define double long double
const int N = 1e6 + 5;
const ll base = 131;
const ll mod = 998244353;
void solve() {
int n;
cin>>n;
vector<int>a(n+1);
for(int i=1;i<=n;++i) cin>>a[i];
set<int>s;
for(int i=1;i<n;++i){
s.insert(a[i]);
s.insert(a[i+1]);
s.insert((a[i]^a[i+1])&(a[i]&a[i+1]));
s.insert(a[i]^a[i+1]);
s.insert(a[i+1]&(a[i]^a[i+1]));
s.insert((a[i]|a[i+1])^a[i+1]);
s.insert(a[i]^a[i+1]);
s.insert(a[i]|a[i+1]);
}
cout<<s.size()<<'\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t = 1;
cin >> t;
while (t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3540kb
input:
2 2 3
output:
2 1
result:
wrong answer 1st lines differ - expected: '4', found: '2'