# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
488711 | irmuun | Star triangles (IZhO11_triangle) | C++17 | 555 ms | 15460 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll n,i,a[300001],b[300001],ans=0;
map<ll,ll>x,y;
cin>>n;
for(i=1;i<=n;i++){
cin>>a[i]>>b[i];
x[a[i]]++;
y[b[i]]++;
}
for(i=1;i<=n;i++){
ans+=(x[a[i]]-1)*(y[b[i]]-1);
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |