QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#798954 | #9557. Temperance | laopohou# | WA | 2ms | 13896kb | C++14 | 1.3kb | 2024-12-04 19:36:00 | 2024-12-04 19:36:00 |
Judging History
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();
}
}
詳細信息
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'