QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#706580#6701. BaoBao Loves Readingfutarian#WA 1ms3764kbC++14619b2024-11-03 12:23:562024-11-03 12:23:57

Judging History

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

  • [2024-11-03 12:23:57]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3764kb
  • [2024-11-03 12:23:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int Len = 1e5 + 5;
int a[Len],n,pre[Len],b[Len],sum[Len];
int main()
{
	int T;scanf("%d",&T);
	for(int j = 1 ; j <= T ; j ++)
	{
		scanf("%d",&n);
		for(int i = 1 ; i <= n ; i ++) 
		{
			scanf("%d",&a[i]);
			pre[a[i]] = 0;
		}
		for(int i = 1 ; i <= n ; i ++)
		{
			if(pre[a[i]]) 
			{
				b[i] = i - pre[a[i]];
				sum[b[i]] ++;
			}
			pre[a[i]] = i;
		}
		for(int i = 1 ; i <= n ; i ++) sum[i] += sum[i - 1];
		for(int i = 1 ; i < n ; i ++) printf("%d ",n - sum[i]);
		printf("%d",n - sum[n]);
		if(j != T) puts("");
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
7
4 3 4 2 3 1 4

output:

7 6 5 4 4 4 4

result:

ok single line: '7 6 5 4 4 4 4'

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3764kb

input:

100
73
45 45 2 2 2 45 35 45 16 35 16 45 35 2 16 16 45 2 45 45 16 35 35 16 35 35 2 2 2 35 45 35 45 35 16 35 2 2 16 35 16 45 45 16 45 2 16 16 35 16 45 16 45 45 16 16 35 35 35 35 45 45 45 35 16 16 16 2 16 16 35 16 2
83
78 52 7 35 33 82 51 27 45 34 17 51 55 25 26 11 52 41 25 41 13 46 33 83 83 7 40 51 33...

output:

51 36 30 22 19 18 16 13 7 7 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
58 18 -27 -79 -136 -194 -253 -313 -381 -447 -517 -588 -657 -726 -796 -866 -935 -1006 -1074 -1143 -1211 -1281 -1351 -1420 -1489 -1560 -1630 -1699 -...

result:

wrong answer 1st lines differ - expected: '51 30 17 4 4 4 4 4 4 4 4 4 4 4...4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4', found: '51 36 30 22 19 18 16 13 7 7 5 ...4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4'