QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#753657#9557. Temperanceucup-team4801#WA 0ms3832kbC++14733b2024-11-16 13:23:392024-11-16 13:23:47

Judging History

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

  • [2024-11-16 13:23:47]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3832kb
  • [2024-11-16 13:23:39]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
const int N=1e5+10;
int n,a[N][3],p[N],mn[N],ans[N];
int main(){
    int T,la;scanf("%d",&T);while(T--){
        scanf("%d",&n);rep(i,1,n) rep(j,0,2) scanf("%d",&a[i][j]),mn[i]=0;
        rep(op,0,2){
            iota(p+1,p+n+1,1);sort(p+1,p+n+1,[&](int A,int B){return a[A][op]<a[B][op];});
            la=0;rep(i,1,n) if(a[p[i]][op]!=a[p[i+1]][op]) {rep(j,la+1,i) mn[p[j]]=max(mn[p[j]],i-la);la=i;}
        }
        rep(i,0,n) ans[i]=0;rep(i,1,n) ++ans[mn[i]-1];
        per(i,n-1,0) ans[i]+=ans[i+1];
        rep(i,0,n-1) printf("%d ",n-ans[i]);puts("");
    }
    return 0;
}

详细

Test #1:

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

input:

2
5
1 1 1
1 1 2
1 1 3
2 3 5
2 2 4
3
1 1 1
2 2 2
3 3 3

output:

0 0 2 5 5 
0 3 3 

result:

ok 8 numbers

Test #2:

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

input:

16
1
1 1 1
2
1 1 1
1 1 100000
3
1 1 1
1 1 100000
1 100000 1
4
1 1 1
1 1 100000
1 100000 1
1 100000 100000
5
1 1 1
1 1 100000
1 100000 1
1 100000 100000
100000 1 1
6
1 1 1
1 1 100000
1 100000 1
1 100000 100000
100000 1 1
100000 1 100000
7
1 1 1
1 1 100000
1 100000 1
1 100000 100000
100000 1 1
100000 ...

output:

0 
0 0 
0 0 0 
0 0 0 0 
0 0 0 1 5 
0 0 0 0 6 6 
0 0 0 0 7 7 7 
0 0 0 0 8 8 8 8 
0 
0 0 
0 0 0 
0 0 4 4 
0 0 0 1 5 
0 0 0 0 6 6 
0 0 0 0 7 7 7 
0 0 0 0 8 8 8 8 

result:

wrong answer 45th numbers differ - expected: '0', found: '4'