# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
868102 | 12345678 | Star triangles (IZhO11_triangle) | C++17 | 248 ms | 12124 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;
long long n, ans;
map<int, int> x, y;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
vector<pair<int, int>> v(n);
for (int i=0; i<n; i++) cin>>v[i].first>>v[i].second, x[v[i].first]++, y[v[i].second]++;
for (int i=0; i<n; i++) ans+=(x[v[i].first]-1)*(y[v[i].second]-1);
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |