QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#794458#9557. TemperanceneibWA 1ms8016kbC++14811b2024-11-30 14:22:062024-11-30 14:22:08

Judging History

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

  • [2024-11-30 14:22:08]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:8016kb
  • [2024-11-30 14:22:06]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 200005;
ll t;
ll n;
map <ll, ll> mpx, mpy, mpz;
struct node
{
	ll x, y, z;
}a[MAXN];
ll m[MAXN];
ll c[100005];

int main()
{
	cin >> t;
	while(t--)
	{
		cin >> n;
		memset(c, 0, sizeof(c));
		ll x, y, z;
		for(int i = 1;i <= n;i++)
		{
			cin >> x >> y >> z;
			mpx[x]++;
			mpy[y]++;
			mpz[z]++;
			a[i].x = x; a[i].y = y; a[i].z = z;
		}
		for(int i = 1;i <= n;i++)
		{
			m[i] = max(max(mpx[a[i].x], mpy[a[i].y]), mpz[a[i].z]) - 1;
			//cout << m[i] << " ";
			c[m[i]]++;
		}
		cout << 0 << " ";
		for(int i = 1;i <= n - 1;i++){
			c[i] = c[i - 1] + c[i];
			cout << c[i] << " ";
		}
		cout << endl;
		mpx.clear(); mpy.clear(); mpz.clear();
	}
	
	
	
	
	
	
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 8016kb

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'