| # | Time | 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
    freopen("TASK.inp", "r", stdin);
    freopen("TASK.out", "w", stdout);
#endif
    auto start_time = chrono::steady_clock::now();
    cin.tie(0), cout.tie(0) -> sync_with_stdio(0);
    you_make_it();
    auto end_time = chrono::steady_clock::now();
    cerr << "\nExecution time : " << chrono::duration_cast <chrono::milliseconds> (end_time - start_time).count() << "[ms]" << endl;
    return (0 ^ 0);
}
// Dream it. Wish it. Do it.
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
