Submission #976878

#TimeUsernameProblemLanguageResultExecution timeMemory
976878vjudge1Star triangles (IZhO11_triangle)C++17
100 / 100
406 ms15464 KiB
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; cin >> n; map<int, int> cx, cy; int x[n+1], y[n+1]; for(int i = 0; i < n; i++){ cin >> x[i] >> y[i]; cx[x[i]]++; cy[y[i]]++; } int ans = 0; for(int i = 0; i < n; i++){ ans += (cx[x[i]] - 1) * (cy[y[i]] - 1); } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...