Submission #333888

#TimeUsernameProblemLanguageResultExecution timeMemory
333888BY_KUTBILIMStar triangles (IZhO11_triangle)C++14
100 / 100
375 ms6252 KiB
/** @BY_KUTBILIM **/
#include <bits/stdc++.h>
using namespace std;

#define ff first
#define ss second
#define pb push_back
#define ll long long

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie();

    int n;
    cin >> n;
    int x[n], y[n];
    map<int,int> ox, oy;
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
        ox[x[i]]++;
        oy[y[i]]++;
    }
    ll ans = 0;
    for(int i = 0; i < n; i++){
        ans += 1LL * (ox[x[i]] - 1) * (oy[y[i]] - 1);
    }
    cout << ans << endl;
    
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...