Submission #1136138

#TimeUsernameProblemLanguageResultExecution timeMemory
1136138yoshiStar triangles (IZhO11_triangle)C++20
100 / 100
272 ms9236 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; void uwu(){ ll n; cin>>n; ll x[n],y[n]; map<ll,ll> a,b; for(ll i=0; i<n; i++){ cin>>x[i]>>y[i]; a[x[i]]++; b[y[i]]++; } ll ans=0; for(ll i=0; i<n; i++){ ans+=(a[x[i]]-1)*(b[y[i]]-1); } cout<<ans<<"\n"; } int main(){ ios::sync_with_stdio(false); cin.tie(0); ll t=1; //cin>>t; while(t--){ uwu(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...