Submission #976054

#TimeUsernameProblemLanguageResultExecution timeMemory
976054vjudge1Star triangles (IZhO11_triangle)C++17
100 / 100
374 ms5820 KiB
#include <bits/stdc++.h> using namespace std; const int kaps = 3e5 + 5; int main(){ long long n; cin >> n; int x[kaps], y[kaps]; int ans = 0; map <int, int> jx; map <int, int> jy; for(int i = 0; i < n; i++){ cin >> x[i] >> y[i]; jx[x[i]]++; jy[y[i]]++; }for(int i = 0; i < n; i++){ ans += (jx[x[i]] - 1) * (jy[y[i]] - 1); }cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...