QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#858342 | #9557. Temperance | Ileana | WA | 0ms | 3712kb | C++23 | 1.0kb | 2025-01-16 16:26:55 | 2025-01-16 16:27:25 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
struct pos
{
int x,y,z;
}p[100005];
int x[100005],y[100005],z[10005];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t,n;
cin>>t;
while(t--)
{
cin>>n;
for(int i=0;i<n;++i)
{
cin>>p[i].x>>p[i].y>>p[i].z;
x[p[i].x]++;
y[p[i].y]++;
z[p[i].z]++;
}
map<int,int> mp;
for(int i=0;i<n;++i)
{
int nx=x[p[i].x];
int ny=y[p[i].y];
int nz=z[p[i].z];
int ma=max(nx,max(ny,nz));
mp[ma]++;
}
long long count=0;
for(int i=0;i<n;++i)
{
if(mp.find(i)!=mp.end())
{
count+=mp[i];
}
cout<<mp[i]<<" ";
}
cout<<endl;
mp.clear();
for (int i = 0; i < n; i++)
{
x[p[i].x]--, y[p[i].y]--, z[p[i].z]--;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
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 3 0 0 3 0
result:
wrong answer 4th numbers differ - expected: '5', found: '3'