# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1100557 | vjudge1 | Star triangles (IZhO11_triangle) | Cpython 3 | 2058 ms | 21628 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.
n = int(input())
p = [[0, 0] for _ in range(n)]
x = [0] * n
y = [0] * n
xsum = [0] * n
ysum = [0] * n
ans = 0
for i in range(n):
x[i], y[i] = map(int, input().split())
p[i][0] = x[i]
p[i][1] = y[i]
x.sort()
y.sort()
for i in range(n):
p[i][0] = x.index(p[i][0])
p[i][1] = y.index(p[i][1])
xsum[p[i][0]] += 1
ysum[p[i][1]] += 1
for i in range(n):
ans += (xsum[p[i][0]] - 1) * (ysum[p[i][1]] - 1)
print(ans)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |