Submission #724050

#TimeUsernameProblemLanguageResultExecution timeMemory
724050groshiStar triangles (IZhO11_triangle)C++17
100 / 100
373 ms15576 KiB
#include<bits/stdc++.h> #define int long long using namespace std; map<int,int> mapka1,mapka2; int t[400000][2]; int32_t main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n,x,y; cin>>n; for(int i=1;i<=n;i++) { cin>>x>>y; mapka1[x]++; mapka2[y]++; t[i][0]=x; t[i][1]=y; } int wynik=0; for(int i=1;i<=n;i++) { int a=mapka1[t[i][0]]; int b=mapka2[t[i][1]]; wynik+=(a-1)*(b-1); } cout<<wynik; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...