Result: Accepted
Time: 4ms
Memory: 1756kB
#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");
}