QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#858342#9557. TemperanceIleanaWA 0ms3712kbC++231.0kb2025-01-16 16:26:552025-01-16 16:27:25

Judging History

你现在查看的是最新测评结果

  • [2025-01-16 16:27:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3712kb
  • [2025-01-16 16:26:55]
  • 提交

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;
}

詳細信息

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'