# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1100598 | vjudge1 | Star triangles (IZhO11_triangle) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
signed main()
{
int n;
cin >> n;
int x[100000, y[100000];
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;
}