QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#798954#9557. Temperancelaopohou#WA 2ms13896kbC++141.3kb2024-12-04 19:36:002024-12-04 19:36:00

Judging History

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

  • [2024-12-04 19:36:00]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:13896kb
  • [2024-12-04 19:36:00]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long 
const int N=2e5+10;
int n,m;
int x[N];
int y[N];
int z[N];
int dx[N];
int dy[N];
int dz[N];
int d[N];
priority_queue<int,vector<int> ,greater<int> > q;
priority_queue<int,vector<int> ,greater<int> > q2;
void solve(){
    for(int i=1;i<=10000;i++){
        dx[i]=0;
        dy[i]=0;
        dz[i]=0;
    }
    cin >> n;
    for(int i=1;i<=n;i++){
        int a,b,c;
        cin >> a >> b >> c;
        x[i]=a;
        y[i]=b;
        z[i]=c;
        dx[a]++;
        dy[b]++;
        dz[c]++;
    }
    
    while(q.size()!=0){
        q.pop();
    }
    while(q2.size()!=0){
        q2.pop();
    }
    for(int i=1;i<=n;i++){
        int num1=dx[x[i]]-1;
        int num2=dy[y[i]]-1;
        int num3=dz[z[i]]-1;
        d[i]=max(num1,max(num2,num3));
        //cout <<  d[i] << ' ';
    }
    for(int i=1;i<=n;i++){
        q.push(d[i]);
        q2.push(d[i]);
    }
    //cout << "--" << q.top() << ' ';
    for(int k=0;k<=n-1;k++){
        q=q2;
        int cnt=0;
        while(q.size()!=0&&q.top()<k){
            cnt++;
            q.pop();
        }
        cout << cnt << ' ';
    }
    cout << endl;
}
signed main(){
    int T;
    cin >> T;
    while(T--){
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 2ms
memory: 13896kb

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 2 
0 0 0 0 2 2 
0 0 0 0 1 1 2 
0 0 0 0 1 1 1 1 
0 
0 0 
0 0 0 
0 0 0 0 
0 0 0 0 1 
0 0 0 0 1 1 
0 0 0 0 1 1 1 
0 0 0 0 1 1 1 1 

result:

wrong answer 15th numbers differ - expected: '5', found: '2'