# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
888128 | tigran | Star triangles (IZhO11_triangle) | C++17 | 391 ms | 13296 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;
int main()
{
int n;
cin>>n;
map <int, int> x, y;
vector<pair<int, int>> queries;
for(int i=0;i<n;i++){
int X, Y;
cin>>X>>Y;
queries.push_back({X, Y});
x[X]++;
y[Y]++;
}
long long q=0;
for(int i=0;i<n;i++){
q+=(x[queries[i].first]-1)*(y[queries[i].second]-1);
}
cout<<q;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |