Submission #899210

#TimeUsernameProblemLanguageResultExecution timeMemory
899210pccStar triangles (IZhO11_triangle)C++14
100 / 100
254 ms5980 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tlll tuple<ll,ll,ll> const int mxn = 3e5+10; map<int,int> xcnt,ycnt; pii arr[mxn]; int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n; cin>>n; for(int i = 0;i<n;i++){ cin>>arr[i].fs>>arr[i].sc; xcnt[arr[i].fs]++; ycnt[arr[i].sc]++; } ll ans = 0; for(int i = 0;i<n;i++){ ans += 1ll*(xcnt[arr[i].fs]-1)*(ycnt[arr[i].sc]-1); } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...