Submission #318557

#TimeUsernameProblemLanguageResultExecution timeMemory
318557sofapudenStar triangles (IZhO11_triangle)C++14
100 / 100
598 ms12328 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; map<int,int> X, Y; vector<pair<int,int>> v(n); for(auto &x : v){cin >> x.first >> x.second;X[x.first]++, Y[x.second]++;} long long ans = 0; for(int i = 0; i < n; ++i){ ans+=(X[v[i].first]-1)*(Y[v[i].second]-1); } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...