# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
46965 | robert | Star triangles (IZhO11_triangle) | C++14 | 568 ms | 38900 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 <cstdio>
#include <map>
using namespace std;
int main(){
int N; scanf("%d", &N);
int x[300100], y[300100];
map<int, int> ctx, cty;
for(int n=0; n<N; n++){
scanf("%d %d", &x[n], &y[n]);
ctx[x[n]]++;
cty[y[n]]++;
}
long long ans = 0;
for(int n=0; n<N; n++){
ans += (ctx[x[n]]-1)*(cty[y[n]]-1);
}
printf("%lld\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |