# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
546318 | krit3379 | Star triangles (IZhO11_triangle) | C++17 | 388 ms | 13204 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 N 300005
int x[N],y[N];
long long ans;
map<int,long long> mpx,mpy;
int main(){
int n,i;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d %d",&x[i],&y[i]);
mpx[x[i]]++;
mpy[y[i]]++;
}
for(i=1;i<=n;i++){
ans+=(mpx[x[i]]-1)*(mpy[y[i]]-1);
}
printf("%lld",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |