# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413427 | aris12345678 | Star triangles (IZhO11_triangle) | C++14 | 396 ms | 12164 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;
const int mxN = 300005;
int x[mxN], y[mxN];
int main() {
int n;
scanf("%d", &n);
map<int, int> x_axis, y_axis;
for(int i = 0; i < n; i++) {
scanf("%d %d", &x[i], &y[i]);
x_axis[x[i]]++;
y_axis[y[i]]++;
}
long long ans = 0;
for(int i = 0; i < n; i++) {
ans += (x_axis[x[i]]-1)*(y_axis[y[i]]-1);
}
printf("%d\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |