# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136138 | yoshi | Star triangles (IZhO11_triangle) | C++20 | 272 ms | 9236 KiB |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
void uwu(){
ll n;
cin>>n;
ll x[n],y[n];
map<ll,ll> a,b;
for(ll i=0; i<n; i++){
cin>>x[i]>>y[i];
a[x[i]]++;
b[y[i]]++;
}
ll ans=0;
for(ll i=0; i<n; i++){
ans+=(a[x[i]]-1)*(b[y[i]]-1);
}
cout<<ans<<"\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll t=1;
//cin>>t;
while(t--){
uwu();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |