시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 (추가 시간 없음) | 1024 MB | 32 | 19 | 14 | 56.000% |
Pusheen wants to build a treehouse in the Treehouse forest in Brunnshög in the north of Lund. The treehouse should to be built on a square platform in the treetops, with a tree in each of the four corners. When Pusheen has picked a spot to built the treehouse, trees that are located between the corners will be cut down. Pusheen has a 2D map with all the (x, y)-coordinates of the trees in the forest. In how many places can they build a square treehouse?
The first line has an integer $4 \leq N \leq 2\, 000 $, the number of trees in the forest. Each of the following $N$ lines has two integers $-10,000\leq x_i, y_i \leq 10,000$, the x- and y-coordinates of tree $i$. All points are distinct.
An integer, the number of suitable spots for a tree house.
번호 | 배점 | 제한 |
---|---|---|
1 | 20 | $N \leq 50$ |
2 | 80 | No further restrictions |
9 1 5 1 7 3 1 3 5 3 7 5 7 6 2 7 3 7 6
2
Illustration of the two possible treehouse locations in sample 1.
Contest > Swedish Coding Cup > LTH Challenge 2022 C번