Submission #976474

#TimeUsernameProblemLanguageResultExecution timeMemory
976474vjudge1Star triangles (IZhO11_triangle)C++17
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pll pair<ll,ll> const ll MOD=1e9+7; //#define ll int //KALAU TAKUT RTE bool cmp (pair<ll,ll> x, pair<ll,ll>y){ return x.second < y.second; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); ll n; cin>>n; ll x[n+1], y[n+1], cntx[n+1], cnty[n+1]; for (int i=1; i<=n;i++){ cin>>x[i]>>y[i]; cntx[x[i]]++; cnty[y[i]]++; } ll ans=0; for (int i=1; i<=n;i++){ ans+= (cntx[x[i]]-1) * (cnty[y[i]]-1); } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...