Submission #1112562

#TimeUsernameProblemLanguageResultExecution timeMemory
1112562TsaganaStar triangles (IZhO11_triangle)C++14
100 / 100
412 ms15432 KiB
#include<bits/stdc++.h> using namespace std; #define L long long int main(){ L n,i,a[300001],b[300001],s=0; map<L,L>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++){ s+=(x[a[i]]-1)*(y[b[i]]-1); } cout<<s; }
#Verdict Execution timeMemoryGrader output
Fetching results...