# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
334057 | iulia13 | Star triangles (IZhO11_triangle) | C++14 | 667 ms | 8940 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |