Submission #37258

#TimeUsernameProblemLanguageResultExecution timeMemory
37258Yusup01Star triangles (IZhO11_triangle)C++14
100 / 100
679 ms10960 KiB
#include<bits/stdc++.h> using namespace std; long long x[300009],y[300009],jog; int n; map<long long,int> X,Y; int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); // freopen("triangle.in","r",stdin); // freopen("triangle.out","w",stdout); cin>>n; for(int i=1;i<=n;i++){cin>>x[i]>>y[i]; X[x[i]]++; Y[y[i]]++;} for(int i=1;i<=n;i++) { jog+=(X[x[i]]-1)*(Y[y[i]]-1); } cout<<jog; }
#Verdict Execution timeMemoryGrader output
Fetching results...