Submission #932442

#TimeUsernameProblemLanguageResultExecution timeMemory
932442AiperiiiStar triangles (IZhO11_triangle)C++14
100 / 100
410 ms21824 KiB
#include <bits/stdc++.h> #define int long long #define ff first #define ss second #define all(x) x.begin(),x.end() #define pb push_back using namespace std; signed main(){ ios_base::sync_with_stdio(); cin.tie(0);cout.tie(0); int n; cin>>n; map <int,vector <int> > xy,yx; for(int i=0;i<n;i++){ int x,y;cin>>x>>y; xy[x].pb(y); yx[y].pb(x); } int ans=0; for(auto i : xy){ for(auto y : i.ss){ ans+=((i.ss.size()-1)*(yx[y].size()-1)); } } cout<<ans<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...