# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344249 | katearima | Star triangles (IZhO11_triangle) | C++14 | 671 ms | 12396 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>
#define ss second
#define ff first
using namespace std;
const int N=3e5+10;
int n, x[N], y[N], ans;
map<int, int> fx, fy;
main(){
cin>>n;
for(int i=0; i<n; i++){
cin>>x[i]>>y[i];
fx[x[i]]++;
fy[y[i]]++;
}
for(int i=0; i<n; i++){
ans+=(fx[x[i]]-1)*(fy[y[i]]-1);
}
cout<<ans<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |