제출 #336085

#제출 시각아이디문제언어결과실행 시간메모리
336085nikatamliani별들과 삼각형 (IZhO11_triangle)C++14
100 / 100
700 ms12172 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5+10;
int x[N], y[N];
map<int,int> X, Y;
int main() {
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++i) {
        cin >> x[i] >> y[i];
        ++X[x[i]];
        ++Y[y[i]];
    }
    long long ans = 0;
    for(int i = 1; i <= n; ++i) {
        ans += (long long)(X[x[i]] - 1) * (Y[y[i]] - 1); 
    }
    cout << ans << '\n';
}
#Verdict Execution timeMemoryGrader output
Fetching results...