QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#767239 | #9541. Expanding Array | yld# | WA | 0ms | 3520kb | C++20 | 911b | 2024-11-20 20:19:17 | 2024-11-20 20:19:18 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
void solve()
{
int n;
cin>>n;
vector<int> a(n+1);
set<int> s;
for(int i=1;i<=n;i++) cin>>a[i],s.insert(a[i]);
for(int i=1;i<n;i++)
{
int A=a[i]&a[i+1];
int B=a[i]|a[i+1];
int C=a[i]^a[i+1];
s.insert(A);
s.insert(B);
s.insert(C);
s.insert(A^a[i]);
s.insert(A^a[i+1]);
s.insert(A|a[i]);
s.insert(A|a[i+1]);
s.insert(B&a[i]);
s.insert(B&a[i+1]);
s.insert(B^a[i]);
s.insert(B^a[i+1]);
s.insert(C&a[i]);
s.insert(C&a[i+1]);
s.insert(C|a[i]);
s.insert(C|a[i+1]);
}
cout<<s.size()<<endl;
}
signed main()
{
cin.tie(0)->sync_with_stdio(0);
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: 3492kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3460kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3520kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'