Submission #1100557

#TimeUsernameProblemLanguageResultExecution timeMemory
1100557vjudge1Star triangles (IZhO11_triangle)Cpython 3
0 / 100
2058 ms21628 KiB
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 timeMemoryGrader output
Fetching results...