QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#706580 | #6701. BaoBao Loves Reading | futarian# | WA | 1ms | 3764kb | C++14 | 619b | 2024-11-03 12:23:56 | 2024-11-03 12:23:57 |
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);
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;
}
詳細信息
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'