Submission #344326

#TimeUsernameProblemLanguageResultExecution timeMemory
344326nicolaalexandraStar triangles (IZhO11_triangle)C++14
100 / 100
584 ms5740 KiB
#include <bits/stdc++.h> #define DIM 300010 using namespace std; map <int,int> x,y; pair <int,int> v[DIM]; int n,i; int main (){ //ifstream cin ("date.in"); //ofstream cout ("date.out"); cin>>n; for (i=1;i<=n;i++){ cin>>v[i].first>>v[i].second; x[v[i].first]++; y[v[i].second]++; } long long sol = 0; for (i=1;i<=n;i++) sol += 1LL * (x[v[i].first] - 1) * (y[v[i].second] - 1); cout<<sol; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...