QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#779281 | #9541. Expanding Array | oumashu | WA | 0ms | 31096kb | C++17 | 738b | 2024-11-24 18:10:51 | 2024-11-24 18:10:51 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
const int N=1e6+10,mod=998244353;
typedef pair<int,int> pii;
int T;
int n,q,k,m,t;
int a[N],b[N];
vector<pii>g[N];
void solve()
{
set<int>s;
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n-1;i++)
{
int x=a[i]^a[i+1],y=a[i]&a[i+1],z=a[i]|a[i+1];
s.insert(a[i]);s.insert(a[i+1]);
s.insert(x);s.insert(y);s.insert(z);
s.insert(a[i]^y);s.insert(a[i+1]^y);
s.insert(a[i]^z);s.insert(a[i+1]^z);
}
cout<<s.size();
}
signed main()
{
ios;
T=1;
// cin>>T;
while(T--)solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 30168kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 30464kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 31096kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'