QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#772305 | #9557. Temperance | Bulonte | WA | 2ms | 9736kb | C++23 | 1.3kb | 2024-11-22 18:33:09 | 2024-11-22 18:33:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5+5;
struct NODE
{
int x,y,z;
int A;
}plant[N];
int cntx[N],cnty[N],cntz[N];;
int ans[N];
int pre[N];
bool cmp(NODE aa,NODE bb){return aa.A<bb.A;}
void solve()
{
int n;cin>>n;
for(int i = 1;i<=n;i++)
{
plant[i] = {0,0,0,0};
cntx[i] = cnty[i] = cntz[i] = 0;
ans[i] = 0;
pre[i] = 0;
}
for(int i = 1;i<=n;i++)
{
int x,y,z;cin>>x>>y>>z;
cntx[x] ++;cnty[y] ++;cntz[z] ++;
plant[i].x = x;plant[i].y = y;plant[i].z = z;
}
for(int i = 1;i<=n;i++)
{
plant[i].A = max(cntx[plant[i].x],max(cnty[plant[i].y],cntz[plant[i].z]))-1;
if(plant[i].A < 0) plant[i].A = 0;
ans[plant[i].A] ++;
}
//sort(plant+1,plant+1+n,cmp);
for(int i = 1;i<=n;i++){cout<<plant[i].x<<plant[i].y<<plant[i].z<<plant[i].A<<endl;}
//for(int i = 0;i<=n;i++){cout<<ans[i]<<endl;}
// pre[0] = 0;
// for(int i = 1;i<n;i++)
// {
// pre[i] = pre[i-1] + ans[i-1];
// }
// for(int i = 0;i<n;i++)
// {
// cout<<pre[i]<<" ";
// }
// cout<<endl;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int T;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: 2ms
memory: 9736kb
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:
1112 1122 1132 2351 2241 1110 2220 3330
result:
wrong answer 1st numbers differ - expected: '0', found: '1112'