QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73276#1438. Ballszhangboju#WA 2ms3704kbC++14480b2023-01-23 13:03:272023-01-23 13:03:28

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-23 13:03:28]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3704kb
  • [2023-01-23 13:03:27]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
template <typename T> inline void read(T &x)
{
	x=0;short f=1;char c=getchar();
	for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
	for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
	x*=f;return;
}
const int N=1e5+5;
int n;
int a[N];
set<int>S;
int main()
{
	read(n);
	for(int i=1;i<=n;++i) read(a[i]);
	for(int i=1;i+2<=n;++i)
		if(a[i]==a[i+1]||a[i]==a[i+2])
			S.insert(a[i]);
	printf("%d\n",S.size());
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3504kb

input:

7
3 1 3 2 1 2 3

output:

2

result:

ok "2"

Test #2:

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

input:

10
31692384 31692384 31692384 31692384 31692384 31692385 31692384 31692385 31692385 31692385

output:

2

result:

ok "2"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3488kb

input:

10
41086958 41086959 41086959 41086958 41086958 41086959 41086959 41086959 41086958 41086959

output:

2

result:

ok "2"

Test #4:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

10
30400813 30400814 30400814 30400813 30400814 30400813 30400813 30400813 30400814 30400814

output:

2

result:

ok "2"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3532kb

input:

10
41086958 41086958 41086958 41086960 41086960 41086959 41086959 41086959 41086958 41086958

output:

3

result:

ok "3"

Test #6:

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

input:

10
30400813 30400815 30400815 30400813 30400814 30400815 30400815 30400813 30400813 30400814

output:

2

result:

ok "2"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

10
40894490 40894491 40894490 40894490 40894491 40894490 40894490 40894490 40894489 40894490

output:

1

result:

ok "1"

Test #8:

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

input:

10
30400813 30400814 30400814 30400813 30400816 30400813 30400815 30400813 30400816 30400816

output:

2

result:

wrong answer 1st words differ - expected: '3', found: '2'