QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#883032 | #9557. Temperance | Nimi_Sora# | RE | 1ms | 3712kb | C++23 | 935b | 2025-02-05 14:28:34 | 2025-02-05 14:28:41 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e6+7;
using pii=pair<int,int>;
#define fi first
#define se second
struct P{
ll x,y,z;
};
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int tt=1;
cin>>tt;
while(tt--){
ll n;cin>>n;
vector<P>ve(n+5);
vector<array<ll,3>>cnt(n+5);
vector<ll>c(n+5),pre(n+5);
for(int i=1;i<=n;i++){
ll x,y,z;cin>>x>>y>>z;
ve[i]={x,y,z};
cnt[x][0]++,cnt[y][1]++,cnt[z][2]++;
}
for(int i=1;i<=n;i++){
ll x=ve[i].x,y=ve[i].y,z=ve[i].z;
c[i]=max(cnt[x][0],max(cnt[y][1],cnt[z][2]));
// cout<<c[i]<<'x';
pre[c[i]]++;
}
for(int i=1;i<=n;i++){
pre[i]+=pre[i-1];
}
for(int i=0;i<n;i++)cout<<pre[i]<<' ';cout<<'\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3712kb
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
Runtime Error
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 ...