제출 #1240309

#제출 시각아이디문제언어결과실행 시간메모리
1240309themoon별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
382 ms9236 KiB
#include <bits/stdc++.h>
#define int long long
#define bismillah ios_base::sync_with_stdio(false);
using namespace std;

signed main() {
    bismillah;

    int n;
    cin >> n;
    map<int, int> X, Y;
    int x[n+5], y[n+5];
    for(int i = 1; i <= n; i++){
        cin >> x[i] >> y[i];
        X[x[i]]++;
        Y[y[i]]++;
    }
    int ans = 0;
    for(int i = 1; i <= n; i++){
        ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
    }
    cout << ans <<endl;

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