Submission #17682

#TimeUsernameProblemLanguageResultExecution timeMemory
17682ElibayStar triangles (IZhO11_triangle)C++14
100 / 100
456 ms7104 KiB
#include <bits/stdc++.h> #define Fname "triangles" using namespace std; const int MaxN = 3e5 + 17, INF = 1e9 + 17, Mod = 1e9 + 7; map < int, int > mx; map < int, int > my; int x[MaxN], y[MaxN], n; long long Sum; int main () { #ifdef Elibay freopen (".in", "r", stdin); #endif scanf ("%d", &n); for (int i = 1; i <= n; ++ i) scanf ("%d%d", &x[i], &y[i]), mx[x[i]] ++, my[y[i]] ++; for (int i = 1; i <= n; ++ i) Sum += (mx[x[i]] - 1) * (my[y[i]] - 1); printf ("%lld", Sum); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...