Submission #976650

#TimeUsernameProblemLanguageResultExecution timeMemory
976650vjudge1Star triangles (IZhO11_triangle)C++17
100 / 100
453 ms17016 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { map<ll, int> datx; map<ll, int> daty; int n; cin >> n; vector <pair<ll, ll>> titik; for (int i=0;i<n;i++) { ll x, y; cin >> x >> y; titik.push_back({x, y}); datx[x]++; daty[y]++; } ll ans = 0; for (auto i:titik) { ans+= (datx[i.first]-1)*(daty[i.second]-1); } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...