QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#779302 | #9541. Expanding Array | oumashu | WA | 4ms | 29504kb | C++17 | 851b | 2024-11-24 18:18:35 | 2024-11-24 18:18:35 |
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];
// s.insert(0);
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);
s.insert(a[i]&y);s.insert(a[i]|y);
s.insert(a[i+1]&z);s.insert(a[i+1]|z);
}
cout<<s.size();
}
signed main()
{
ios;
T=1;
// cin>>T;
while(T--)solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 29504kb
input:
2 2 3
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 4ms
memory: 29380kb
input:
2 3 4
output:
4
result:
ok single line: '4'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 29088kb
input:
2 3 5
output:
7
result:
wrong answer 1st lines differ - expected: '8', found: '7'