# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1086297 | toast12 | Star triangles (IZhO11_triangle) | C++14 | 384 ms | 12268 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;
using ll = long long;
int main() {
int n;
cin >> n;
map<int, int> x, y;
vector<pair<int, int>> points(n);
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
x[a]++, y[b]++;
points[i].first = a, points[i].second = b;
}
ll ans = 0;
for (int i = 0; i < n; i++) {
ans += 1ll*(x[points[i].first]-1)*(y[points[i].second]-1);
}
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |