Submission #983526

#TimeUsernameProblemLanguageResultExecution timeMemory
983526sofija6Star triangles (IZhO11_triangle)C++14
100 / 100
256 ms15700 KiB
#include <bits/stdc++.h> #define ll long long #define MAXN 300010 using namespace std; map<ll,ll> cntx,cnty; ll x[MAXN],y[MAXN]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n; cin >> n; for (ll i=1;i<=n;i++) { cin >> x[i] >> y[i]; cntx[x[i]]++; cnty[y[i]]++; } ll ans=0; for (ll i=1;i<=n;i++) ans+=(cntx[x[i]]-1)*(cnty[y[i]]-1); cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...