Submission #531684

#TimeUsernameProblemLanguageResultExecution timeMemory
531684makanhuliaStar triangles (IZhO11_triangle)C++17
100 / 100
374 ms15544 KiB
#include <bits/stdc++.h> using namespace std; #define nyahalo ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define otsumiko exit(0); #define mikodanye priority_queue<pair<long long, long long>, vector<pair<long long, long long> >, greater<pair<long long, long long> > > #define mikochi priority_queue<long long, vector<long long>, greater<long long> > long long x[300069], y[300069]; int main() { nyahalo long long n, ans = 0; cin >> n; map<long long, long long> mpx, mpy; for (long long i=1; i<=n; i++) { cin >> x[i] >> y[i]; mpx[x[i]]++; mpy[y[i]]++; } for (long long i=1; i<=n; i++) { ans += (mpx[x[i]]-1)*(mpy[y[i]]-1); } cout << ans << "\n"; otsumiko }
#Verdict Execution timeMemoryGrader output
Fetching results...