제출 #167811

#제출 시각아이디문제언어결과실행 시간메모리
167811itgl별들과 삼각형 (IZhO11_triangle)C++14
100 / 100
900 ms12508 KiB
#include<bits/stdc++.h>
#define ff first
#define ss second

using namespace std;

int n;
int x[300005],y[300005];
map<int,int> mx,my;

int main(){
  cin >> n;
  for(int i=1;i<=n;i++) {
    cin >> x[i] >> y[i];
    mx[x[i]]++;
    my[y[i]]++;
  }
  int res=0;
  for(int i=1;i<=n;i++){
    res+=(mx[x[i]]-1)*(my[y[i]]-1);
  }

  cout << res << '\n';

  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...