Submission #868102

#TimeUsernameProblemLanguageResultExecution timeMemory
86810212345678Star triangles (IZhO11_triangle)C++17
100 / 100
248 ms12124 KiB
#include <bits/stdc++.h> using namespace std; long long n, ans; map<int, int> x, y; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; vector<pair<int, int>> v(n); for (int i=0; i<n; i++) cin>>v[i].first>>v[i].second, x[v[i].first]++, y[v[i].second]++; for (int i=0; i<n; i++) ans+=(x[v[i].first]-1)*(y[v[i].second]-1); cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...