# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1044294 | EntityPlantt | Star triangles (IZhO11_triangle) | C++17 | 72 ms | 11980 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 <iostream>
#include <unordered_map>
using namespace std;
const int N = 3e5 + 5;
pair <int, int> s[N];
unordered_map <int, int> mx, my;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, ans = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s[i].first >> s[i].second;
mx[s[i].first]++;
my[s[i].second]++;
}
for (int i = 0; i < n; i++) {
ans += (mx[s[i].first] - 1) * (my[s[i].second] - 1);
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |