제출 #839213

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

#define fs first
#define ss second
#define ll long long

int main(){
    int n;
    cin >> n;
    map<int, int> X, Y;
    vector<pair<int, int>> a(n);
    for(int i = 0; i < n; i ++){
        cin >> a[i].fs >> a[i].ss;
        X[a[i].fs] ++;
        Y[a[i].ss] ++;
    }
    ll ans = 0;
    for(int i = 0; i < n; i ++)
        ans += 1ll * X[a[i].fs] * Y[a[i].ss];
    cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...