QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#767217 | #9541. Expanding Array | yld# | WA | 0ms | 3656kb | C++20 | 579b | 2024-11-20 20:14:07 | 2024-11-20 20:14:12 |
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];
s.insert(A);
s.insert(a[i]|a[i+1]);
s.insert(a[i]^a[i+1]);
s.insert(A^a[i]);
s.insert(A^a[i+1]);
}
cout<<s.size()<<endl;
}
signed main()
{
cin.tie(0)->sync_with_stdio(0);
int t=1;
while(t--) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3556kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3656kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'