Submission #870415

#TimeUsernameProblemLanguageResultExecution timeMemory
870415boris_7Star triangles (IZhO11_triangle)C++17
0 / 100
1 ms392 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; void solve(){ // freopen ("triangles.in","r",stdin); // freopen ("triangles.out","w",stdout); ll n; cin>>n; map<ll,ll>x,y; for(ll i = 0;i<n;i++){ ll a,b; cin>>a>>b; x[a]++; y[b]++; } ll ans = 0; for(pair<ll,ll> i :x){ for(pair<ll,ll>j:y){ ans+=(i.second-1)*(j.second-1); } } cout<<ans<<endl; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(nullptr); // ll t;cin>>t;while(t--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...