Submission #977200

#TimeUsernameProblemLanguageResultExecution timeMemory
977200suhu88Star triangles (IZhO11_triangle)C++14
0 / 100
2059 ms6740 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]; int main(){ suhu cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]>>b[i]; } ll ans=0; for(int i=1;i<=n;i++){ ll x=0,y=0; for(int j=1;j<=n;j++){ if(j==i)continue; if(a[i]==a[j])x++; if(b[i]==b[j])y++; } ans+=x*y; } cout<<ans<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...