Submission #1086297

#TimeUsernameProblemLanguageResultExecution timeMemory
1086297toast12Star triangles (IZhO11_triangle)C++14
100 / 100
384 ms12268 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; map<int, int> x, y; vector<pair<int, int>> points(n); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; x[a]++, y[b]++; points[i].first = a, points[i].second = b; } ll ans = 0; for (int i = 0; i < n; i++) { ans += 1ll*(x[points[i].first]-1)*(y[points[i].second]-1); } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...