Submission #597196

#TimeUsernameProblemLanguageResultExecution timeMemory
597196Trisanu_DasStar triangles (IZhO11_triangle)C++17
100 / 100
462 ms15584 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; cin >> n; pair<int, int> points[n]; map<int, int> X, Y; for(int i = 0; i < n; i++){ cin >> points[i].first >> points[i].second; X[points[i].first]++; Y[points[i].second]++; } int ans = 0; for(int i = 0; i < n; i++) ans += (X[points[i].first] - 1) * (Y[points[i].second] - 1); cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...