QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#706576 | #6701. BaoBao Loves Reading | futarian# | WA | 0ms | 3880kb | C++14 | 558b | 2024-11-03 12:22:40 | 2024-11-03 12:22:41 |
Judging History
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);
while(T --)
{
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]);puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3880kb
input:
1 7 4 3 4 2 3 1 4
output:
7 6 5 4 4 4 4
result:
wrong answer 1st lines differ - expected: '7 6 5 4 4 4 4', found: '7 6 5 4 4 4 4 '