Submission #889834

#TimeUsernameProblemLanguageResultExecution timeMemory
889834KakarotStar triangles (IZhO11_triangle)C++98
100 / 100
84 ms11872 KiB
#include <bits/stdc++.h> #define ii unordered_map<int,int> #define vi vector<int> #define vii vector<pair<int,int>> using namespace std; void setIO() { cin.tie(0)->sync_with_stdio(0); } void solve() { int n,ans = 0; cin >> n; ii fx,fy; vi X(n),Y(n); for(int i = 0;i < n;++i) { cin >> X[i] >> Y[i]; ++fx[X[i]]; ++fy[Y[i]]; } for(int i = 0;i < n;++i) ans += (fx[X[i]]-1)*(fy[Y[i]]-1); cout << ans; } int main() { setIO(); solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...