제출 #975583

#제출 시각아이디문제언어결과실행 시간메모리
975583vjudge1별들과 삼각형 (IZhO11_triangle)C++17
100 / 100
236 ms5852 KiB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define AC ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fs first
#define sc second
#define pb push_back


int N;
map<int, int> cntx, cnty;
ll ans;
int main() {   
    AC
    cin >> N ;
    int x[N], y[N];
    for(int i=0; i<N; i++){
        cin >> x[i] >> y[i];
        cntx[x[i]]++, cnty[y[i]]++;
    }
    for(int i=0; i<N; i++){
        ans += (ll)(cntx[x[i]]-1)*(ll)(cnty[y[i]]-1);
    }
    cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...