제출 #1257436

#제출 시각아이디문제언어결과실행 시간메모리
1257436dhanan별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
473 ms9216 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ll N; cin >> N;
    vector<ll> x(N + 1), y(N + 1);
    map<ll, ll> barista, kolombus;
    ll ans = 0;

    for(int i = 1; i <= N; i++){

        cin >> x[i] >> y[i];    
    
        barista[x[i]]++;
        kolombus[y[i]]++;

    }

    for(int i = 1; i <= N; i++){
        ll ans_x = barista[x[i]]-1;
        ll ans_y = kolombus[y[i]]-1;

        ans += ans_x * ans_y;

    }

    cout << ans;

}
#Verdict Execution timeMemoryGrader output
Fetching results...