Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 4ms
Memory: 1756kB
Author: CT12812171281
In contest: 1281

#include<cstdio>
#include <algorithm>
#include <iostream>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=15;
int main()
{
	int n,sumx=0,sumy=0,sumz=0,flagx,flagy,flagz;
	int x[maxn],y[maxn],z[maxn];
	while(~scanf("%d",&n))
	{
		sumx=0,sumy=0,sumz=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d %d %d",&x[i],&y[i],&z[i]);
	}
	for(int i=1;i<=n;i++)
	{
		flagx=1,flagy=1,flagz=1;
		for(int j=i+1;j<=n;j++)
		{
			if(x[i]==x[j]&&y[i]==y[j])
				flagx=0;
			if(x[i]==x[j]&&z[i]==z[j])
				flagy=0;
			if(y[i]==y[j]&&z[i]==z[j])
				flagz=0;
		}
		sumx+=flagx;
		sumy+=flagy;
		sumz+=flagz;
	}
	printf("%d %d %d\n",sumx,sumy,sumz);
	}
//		system("pause");
}