QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#725455 | #9541. Expanding Array | xsdgp | WA | 0ms | 3672kb | C++20 | 539b | 2024-11-08 17:56:19 | 2024-11-08 17:56:19 |
Judging History
answer
#include<bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
int n,a[100005];
map<int,bool> mp;
void solve()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<n;i++)
{
int x=a[i],y=a[i+1],z=(a[i]^a[i+1]);
mp[x]=1;
mp[y]=1;
mp[z]=1;
mp[x|y]=1;
mp[x|z]=1;
mp[y|z]=1;
mp[x&y]=1;
mp[x&z]=1;
mp[y&z]=1;
}
cout<<mp.size()<<endl;
}
signed main()
{
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int T=1;
//cin>>T;
while(T--)solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3652kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'