QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#766816 | #9557. Temperance | Wzy | WA | 0ms | 3748kb | C++14 | 1012b | 2024-11-20 18:43:44 | 2024-11-20 18:43:46 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int N=1000010,M=2000010;
const int mod=998244353;
int INF = 1e9;
int h[N],e[M],ne[M],idx;
int T=1;
int st[N],primes[N],cnt;
struct nd
{
int x,y,z;
};
void solve(){
int n;
cin>>n;
map<int,int> mp[4];
vector<nd> req(n);
vector<int> c(n);
for(int i=0;i<n;i++){
int a,b,c;
cin>>a>>b>>c;
mp[1][a]++,mp[2][b]++,mp[3][c]++;
req[i]={a,b,c};
}
for(auto [x,y,z]:req){
int t=max(mp[1][x],mp[2][y]);
t=max(t,mp[3][z])-1;
c[t]++;
}
for(int i=0;i<n;i++){
if(i==0) cout<<0<<" ";
else{
c[i]+=c[i-1];
cout<<c[i]<<" ";
}
}
cout<<endl;
return ;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//int T=1;
cin>>T;
while(T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3748kb
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 2 5 5 5 0 3 3
result:
wrong answer 2nd numbers differ - expected: '0', found: '2'