Submission #382266

#TimeUsernameProblemLanguageResultExecution timeMemory
382266ritul_kr_singhStar triangles (IZhO11_triangle)C++17
100 / 100
446 ms9068 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define sp << " " << #define nl << "\n" signed main(){ cin.tie(0)->sync_with_stdio(0); map<int, int> x, y; int n; cin >> n; pair<int, int> a[n]; for(auto &i : a) cin >> i.first >> i.second, ++x[i.first], ++y[i.second]; int ans = 0; for(auto i : a) ans += (x[i.first]-1LL)*(y[i.second]-1LL); cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...