Submission #344279

#TimeUsernameProblemLanguageResultExecution timeMemory
344279enerelt14Star triangles (IZhO11_triangle)C++14
100 / 100
632 ms7536 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int x[n+1], y[n+1]; map<int, int>ax; map<int, int>ay; for (int i=1;i<=n;i++){ cin>>x[i]>>y[i]; ax[x[i]+1e9]++; ay[y[i]+1e9]++; } long long res=0; for (int i=1;i<=n;i++){ res+=(ax[x[i]+1e9]-1)*(ay[y[i]+1e9]-1); } cout<<res; }
#Verdict Execution timeMemoryGrader output
Fetching results...