Submission #945399

#TimeUsernameProblemLanguageResultExecution timeMemory
945399NourWaelStar triangles (IZhO11_triangle)C++17
100 / 100
256 ms15768 KiB
#include <bits/extc++.h> #define int long long using namespace std; using namespace __gnu_pbds; map<int,int> x,y; signed main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int n; cin>>n; pair<int,int> p [n]; for(int i=0; i<n; i++) { cin>>p[i].first>>p[i].second; x[p[i].first]++, y[p[i].second]++;; } int ans = 0; for(int i=0; i<n; i++) { ans += (x[p[i].first]-1) * (y[p[i].second]-1); } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...