Submission #975533

#TimeUsernameProblemLanguageResultExecution timeMemory
975533vjudge1Star triangles (IZhO11_triangle)C++17
100 / 100
249 ms15684 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define Foxfur ios_base::sync_with_stdio(0);cin.tie(NULL); int32_t main() { Foxfur int n; cin >> n; int maxn = 3e5+5; map <int,int> jmlx; map <int, int> jmly; int arrx[maxn]; int arry[maxn]; for(int i=0; i<n; i++) { cin >> arrx[i] >> arry[i]; jmlx[arrx[i]]++; jmly[arry[i]]++; } int ans=0; for(int i=0; i<n; i++) { ans += 1ll * (jmlx[arrx[i]]-1) * (jmly[arry[i]]-1); } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...