Submission #1100600

#TimeUsernameProblemLanguageResultExecution timeMemory
1100600vjudge1Star triangles (IZhO11_triangle)C++98
100 / 100
392 ms7204 KiB
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; int x[400000], y[400000]; map<int, int> mp1, mp2; for(int i = 0; i < n; i++) { cin >> x[i] >> y[i]; mp1[x[i]]++; mp2[y[i]]++; } int k = 0; for(int i = 0; i < n; i++) { k += (mp1[x[i]] - 1) * (mp2[y[i]] - 1); } cout << k; }
#Verdict Execution timeMemoryGrader output
Fetching results...