Result: Accepted
Time: 4ms
Memory: 1760kB
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<math.h>
#include<map>
#include<string>
using namespace std;
const int maxn=100020;
const int inf=0x3f3f3f;
map<int,int>xoy;
map<int,int>xoz;
map<int,int>yoz;
int main(){
int cntxoy,cntxoz,cntyoz;
int n;
int a,b,c;
while(scanf("%d",&n)!=EOF){
cntxoy=0;
cntxoz=0;
cntyoz=0;
xoy.clear();
xoz.clear();
yoz.clear();
while(n--){
scanf("%d %d %d",&a,&b,&c);
if(xoy[a*1000+b]==0){
cntxoy++;
xoy[a*1000+b]++;
}
if(xoz[a*1000+c]==0){
cntxoz++;
xoz[a*1000+c]++;
}
if(yoz[b*1000+c]==0){
cntyoz++;
yoz[b*1000+c]++;
}
}
printf("%d %d %d\n",cntxoy,cntxoz,cntyoz);
}
}