Submission #977208

#TimeUsernameProblemLanguageResultExecution timeMemory
977208vjudge1Star triangles (IZhO11_triangle)C++17
100 / 100
257 ms9240 KiB
#include<bits/stdc++.h> #define suhu ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define fi first #define se second #define pb push_back using namespace std; typedef long long ll; const ll MAXN=3e5+5; const ll inf=1e18; ll n,a[MAXN],b[MAXN]; map<ll,ll>x; map<ll,ll>y; int main(){ suhu cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]>>b[i]; x[a[i]]++; y[b[i]]++; } ll ans=0; for(int i=1;i<=n;i++){ ans+=(x[a[i]]-1)*(y[b[i]]-1); } cout<<ans<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...