Submission #887307

#TimeUsernameProblemLanguageResultExecution timeMemory
887307alex_2008Star triangles (IZhO11_triangle)C++14
100 / 100
374 ms12120 KiB
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cmath> #include <iomanip> #include <algorithm> #include <vector> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <fstream> #include <bitset> typedef long long ll; using namespace std; const int N = 3e5 + 10; int x[N], y[N]; int main() { int n; cin >> n; map <int, int> mpx, mpy; for (int i = 1; i <= n; i++) { cin >> x[i] >> y[i]; mpx[x[i]]++; mpy[y[i]]++; } ll ans = 0; for (int i = 1; i <= n; i++) { ans += (mpx[x[i]] - 1) * 1ll * (mpy[y[i]] - 1); } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...