Submission #676198

#TimeUsernameProblemLanguageResultExecution timeMemory
676198ToxtaqStar triangles (IZhO11_triangle)C++17
0 / 100
2082 ms3980 KiB
#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; Y[y[i]]--; 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 timeMemoryGrader output
Fetching results...