QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#725455#9541. Expanding ArrayxsdgpWA 0ms3672kbC++20539b2024-11-08 17:56:192024-11-08 17:56:19

Judging History

你现在查看的是最新测评结果

  • [2024-11-08 17:56:19]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2024-11-08 17:56:19]
  • 提交

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'