convex4gon
Time limit2sMemory limit1024 MB
Given n points with no three collinear, count the convex quadrilaterals that can be formed from four of them.
- Level
Medium5 of 10
- Topics
- Geometry, Combinatorics, Brute force
- Solved
- No attempts yet
Problem
There is a point set of distinct points on the -plane (). Every - and -coordinate is an integer whose absolute value is less than . No three distinct points in the set lie on the same line. Count the distinct convex quadrilaterals whose vertices are points from the set.
Input
Write a function convex4gon. The parameter L is a list of length . Each item is a tuple of length 2 holding the x- and y-coordinates of a point, and both coordinates are int objects.
Return value
Return an int object equal to the number of distinct convex quadrilaterals whose vertices are points from the set.