# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91685 | SamAnd | Star triangles (IZhO11_triangle) | C++17 | 672 ms | 12408 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;
#define m_p make_pair
const int N = 300005;
int n;
pair<int, int> a[N];
map<int, int> x, y;
int main()
{
cin >> n;
for (int i = 0; i < n; ++i)
{
cin >> a[i].first >> a[i].second;
x[a[i].first]++;
y[a[i].second]++;
}
long long ans = 0;
for (int i = 0; i < n; ++i)
{
ans += ((x[a[i].first] - 1LL) * (y[a[i].second] - 1LL));
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |