# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975869 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 205 ms | 11808 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;
unordered_map<int, int> xCount, yCount;
vector<pair<int, int>> points(N);
for (int i = 0; i < N; ++i) {
int x, y;
cin >> x >> y;
points[i] = make_pair(x, y);
xCount[x]++;
yCount[y]++;
}
long long totalCount = 0;
for (auto point : points) {
int x = point.first;
int y = point.second;
int sameX = xCount[x];
int sameY = yCount[y];
totalCount += (long long)(sameX - 1) * (sameY - 1);
}
cout << totalCount << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |