Submission #412683

#TimeUsernameProblemLanguageResultExecution timeMemory
412683tempusStar triangles (IZhO11_triangle)C++17
100 / 100
772 ms15596 KiB
#include <bits/stdc++.h> #define ll long long #define endl "\n" #define ios ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); using namespace std; int main() { //ios int n; cin >> n; ll x[n], y[n]; map <ll, ll> m1, m2; for (int i = 0; i < n; ++ i) { cin >> x[i] >> y[i]; m1[x[i]] ++; m2[y[i]] ++; } ll ans = 0; for (int i = 0; i < n; ++ i) { ans += (m1[x[i]] - 1) * (m2[y[i]] - 1); } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...