QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#726149 | #9541. Expanding Array | Arkhell | WA | 1ms | 3548kb | C++14 | 550b | 2024-11-08 21:57:02 | 2024-11-08 21:57:03 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
map<int,int>mp;
int n;
cin>>n;
mp[0]=1;
int pre;
cin>>pre;
mp[pre]=1;
for(int i=2;i<=n;i++){
int x;
cin>>x;
int a=x⪯
int b=x|pre;
int c=x^pre;
mp[x]=1;
mp[a]=1;
mp[b]=1;
mp[c]=1;
pre=x;
}
cout<<mp.size();
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3536kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3548kb
input:
2 3 5
output:
6
result:
wrong answer 1st lines differ - expected: '8', found: '6'