Submission #838649

#TimeUsernameProblemLanguageResultExecution timeMemory
838649fanwenStar triangles (IZhO11_triangle)C++17
0 / 100
81 ms6212 KiB
/** * author : pham van sam * created : 27 August 2023 (Sunday) **/ #include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 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 timeMemoryGrader output
Fetching results...