# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4855 | cki86201 | Star triangles (IZhO11_triangle) | C++98 | 480 ms | 6588 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<stdio.h>
#include<map>
using namespace std;
typedef long long ll;
map <int,int> M[2];
map <int,int>::iterator p;
int x[300030],y[300030];
int main(){
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d",x+i,y+i);
M[0][x[i]]++, M[1][y[i]]++;
}
ll ans = 0;
for(i=0;i<n;i++)ans += (ll)(M[0][x[i]]-1) * (M[1][y[i]]-1);
printf("%lld",ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |