Submission #334057

#TimeUsernameProblemLanguageResultExecution timeMemory
334057iulia13Star triangles (IZhO11_triangle)C++14
100 / 100
667 ms8940 KiB
#include <iostream> #include <map> using namespace std; struct ura{ int x, y; }; ura v[300005]; map <int, int> x; map <int, int> y; int main() { int n, i; cin >> n; long long ans = 0; for (i = 1; i <= n; i++) { cin >> v[i].x >> v[i].y; x[v[i].x]++; y[v[i].y]++; } for (i = 1; i <= n; i++) ans += (long long)(x[v[i].x] - 1) * (y[v[i].y] - 1); cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...