QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#746815#9541. Expanding ArrayNana7#WA 0ms3604kbC++14546b2024-11-14 15:37:032024-11-14 15:37:04

Judging History

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

  • [2024-11-14 15:37:04]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3604kb
  • [2024-11-14 15:37:03]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cstring>
#include<unordered_map>
#define I inline
using namespace std;

const int N = 100010;
int a[N],n,ans;
unordered_map<int,int> mp;

I void ins(int v) {
	if(!mp[v]) {
		mp[v]=1;
		ans++;
	}
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;++i) cin>>a[i];
	for(int i=1;i<n;++i) {
		ins(a[i]); ins(a[i+1]);
		int same=a[i]&a[i+1],dif=a[i]^a[i+1];
		ins(same+dif); ins(same); ins(dif);
		ins(0) ;	
	}
	cout<<ans<<endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3524kb

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3604kb

input:

2
3 5

output:

6

result:

wrong answer 1st lines differ - expected: '8', found: '6'