QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#858349 | #9557. Temperance | Ileana | WA | 35ms | 4608kb | C++23 | 1.0kb | 2025-01-16 16:30:34 | 2025-01-16 16:30:50 |
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<<count<<" ";
}
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: 100
Accepted
time: 0ms
memory: 3584kb
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: 0
Accepted
time: 0ms
memory: 3584kb
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 5 0 0 0 0 6 6 0 0 0 0 7 7 7 0 0 0 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 0 0 0 0 6 6 0 0 0 0 7 7 7 0 0 0 0 8 8 8 8
result:
ok 72 numbers
Test #3:
score: 0
Accepted
time: 31ms
memory: 3584kb
input:
10000 22 1 4 4 7 2 6 6 5 4 4 4 1 1 7 1 7 6 6 5 8 6 4 4 8 6 7 6 1 7 3 5 7 8 5 1 3 2 1 7 1 2 5 6 1 2 3 1 1 7 3 8 1 4 6 6 5 7 4 4 7 7 7 5 3 4 6 13 2 7 3 2 7 5 5 1 5 8 7 1 6 6 7 3 5 8 8 1 6 4 8 4 1 4 3 6 2 5 6 8 4 1 5 5 5 3 4 28 4 7 2 3 8 5 1 1 6 1 7 4 5 5 6 6 1 5 4 5 2 1 1 5 2 6 3 4 3 6 4 5 7 3 3 6 6 8...
output:
0 0 0 0 7 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 0 3 9 13 13 13 13 13 13 13 13 13 0 0 0 0 8 21 21 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 0 0 1 9 9 14 14 14 14 14 14 14 14 14 0 0 0 6 9 12 12 19 19 19 19 19 19 19 19 19 19 19 19 0 0 0 0 3 8 10 22 36 36 36 36 3...
result:
ok 199157 numbers
Test #4:
score: 0
Accepted
time: 35ms
memory: 3584kb
input:
10000 11 16 4 3 13 14 10 6 2 19 4 16 7 13 11 13 18 6 20 19 11 5 17 4 19 2 2 17 8 18 5 14 14 1 39 3 12 9 4 9 17 5 7 2 4 12 15 5 12 14 15 20 16 19 11 12 5 8 13 13 18 12 9 14 15 12 18 13 19 11 18 14 17 14 2 19 4 9 3 10 19 5 2 19 10 12 6 10 6 20 16 18 5 20 6 5 8 5 17 14 19 10 5 5 13 9 9 2 5 16 20 14 14 ...
output:
0 2 11 11 11 11 11 11 11 11 11 0 0 2 11 22 33 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 0 0 3 12 15 15 15 15 15 15 15 15 15 15 15 15 0 1 3 21 25 32 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 3...
result:
ok 199593 numbers
Test #5:
score: -100
Wrong Answer
time: 32ms
memory: 4608kb
input:
10000 22 40126 51309 54005 77536 83774 68530 35537 89229 39298 26549 72686 40526 72054 78714 67371 54406 93387 54598 62891 79741 7031 21699 38166 16961 98001 73695 16118 23105 44313 87949 61147 44816 82830 40866 30839 37096 63254 98489 15491 2724 410 12208 96504 21764 35334 777 98615 64141 98638 282...
output:
0 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 10 10 10 10 10 10 10 10 10 0 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 0 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 2...
result:
wrong answer 3138th numbers differ - expected: '19', found: '17'