Submission #888128

#TimeUsernameProblemLanguageResultExecution timeMemory
888128tigranStar triangles (IZhO11_triangle)C++17
100 / 100
391 ms13296 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; map <int, int> x, y; vector<pair<int, int>> queries; for(int i=0;i<n;i++){ int X, Y; cin>>X>>Y; queries.push_back({X, Y}); x[X]++; y[Y]++; } long long q=0; for(int i=0;i<n;i++){ q+=(x[queries[i].first]-1)*(y[queries[i].second]-1); } cout<<q; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...