# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
838650 | fanwen | Star triangles (IZhO11_triangle) | C++17 | 268 ms | 12176 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.
/**
* author : pham van sam
* created : 27 August 2023 (Sunday)
**/
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
int N, x[MAXN], y[MAXN];
map <int, int> cnt_x, cnt_y;
void you_make_it(void) {
cin >> N;
for (int i = 1; i <= N; ++i) {
cin >> x[i] >> y[i];
cnt_x[x[i]]++, cnt_y[y[i]]++;
}
long long ans = 0;
for (int i = 1; i <= N; ++i) {
ans += 1LL * (cnt_x[x[i]] - 1) * (cnt_y[y[i]] - 1);
}
cout << ans;
}
signed main() {
#ifdef LOCAL
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |