Submission #679964

#TimeUsernameProblemLanguageResultExecution timeMemory
679964Hacv16Star triangles (IZhO11_triangle)C++17
100 / 100
486 ms15484 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 2e6 + 15; ll n, x[MAX], y[MAX], ans; map<ll, ll> fx, fy; int main(void){ cin >> n; for(int i = 1; i <= n; i++){ cin >> x[i] >> y[i]; fx[x[i]]++; fy[y[i]]++; } for(int i = 1; i <= n; i++) ans += (fx[x[i]] - 1) * (fy[y[i]] - 1); cout << ans << '\n'; exit(0); }
#Verdict Execution timeMemoryGrader output
Fetching results...