# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
676197 | Toxtaq | Star triangles (IZhO11_triangle) | C++17 | 2080 ms | 3984 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;
vector<int>x(n), y(n);
map<int, int>X, Y;
for(int i = 0;i < n;++i){
cin >> x[i] >> y[i];
X[x[i]]++;
Y[y[i]]++;
}
int result = 0;
for(int i = 0;i < n;++i){
if(Y[y[i]] < 2)continue;
for(int j = i + 1;j < n;++j){
if(y[i] == y[j])result += X[x[i]] + X[x[j]] - 2;
}
}
cout << result;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |