Submission #1240309

#TimeUsernameProblemLanguageResultExecution timeMemory
1240309themoonStar triangles (IZhO11_triangle)C++20
100 / 100
382 ms9236 KiB
#include <bits/stdc++.h> #define int long long #define bismillah ios_base::sync_with_stdio(false); using namespace std; signed main() { bismillah; int n; cin >> n; map<int, int> X, Y; int x[n+5], y[n+5]; for(int i = 1; i <= n; i++){ cin >> x[i] >> y[i]; X[x[i]]++; Y[y[i]]++; } int ans = 0; for(int i = 1; i <= n; i++){ ans += (X[x[i]] - 1) * (Y[y[i]] - 1); } cout << ans <<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...