Submission #1219539

#TimeUsernameProblemLanguageResultExecution timeMemory
1219539ouhdaoiuwhdStar triangles (IZhO11_triangle)C++20
100 / 100
341 ms5840 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector <int>x(n); vector <int>y(n); map <int,int> x1; map <int,int> y1; for (int i = 0; i < n; ++i){ cin >> x[i] >> y[i]; ++x1[x[i]]; ++y1[y[i]]; } int ans = 0; for (int i = 0; i < n; ++i){ ans+=(x1[x[i]] - 1) * (y1[y[i]] - 1); } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...