Submission #5879

#TimeUsernameProblemLanguageResultExecution timeMemory
5879kriiiStar triangles (IZhO11_triangle)C++98
100 / 100
532 ms7644 KiB
#include <stdio.h> #include <map> using namespace std; map<int, long long> X,Y; int x[300003],y[300003]; int main() { int N; scanf ("%d",&N); for (int i=0;i<N;i++){ scanf ("%d %d",&x[i],&y[i]); X[x[i]]++; Y[y[i]]++; } long long ans = 0; for (int i=0;i<N;i++) ans += (X[x[i]] - 1) * (Y[y[i]] - 1); printf ("%lld\n",ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...