# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344279 | enerelt14 | Star triangles (IZhO11_triangle) | C++14 | 632 ms | 7536 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;
int main(){
int n;
cin>>n;
int x[n+1], y[n+1];
map<int, int>ax;
map<int, int>ay;
for (int i=1;i<=n;i++){
cin>>x[i]>>y[i];
ax[x[i]+1e9]++;
ay[y[i]+1e9]++;
}
long long res=0;
for (int i=1;i<=n;i++){
res+=(ax[x[i]+1e9]-1)*(ay[y[i]+1e9]-1);
}
cout<<res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |