Submission #488711

#TimeUsernameProblemLanguageResultExecution timeMemory
488711irmuunStar triangles (IZhO11_triangle)C++17
100 / 100
555 ms15460 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n,i,a[300001],b[300001],ans=0; map<ll,ll>x,y; cin>>n; for(i=1;i<=n;i++){ cin>>a[i]>>b[i]; x[a[i]]++; y[b[i]]++; } for(i=1;i<=n;i++){ ans+=(x[a[i]]-1)*(y[b[i]]-1); } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...