Submission #976876

#TimeUsernameProblemLanguageResultExecution timeMemory
976876vjudge1Star triangles (IZhO11_triangle)C++17
0 / 100
1 ms600 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) * (cx[y[i]] - 1); } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...