| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 67 | 20 | 18 | 32.727% |
The director of the local Mathematical Institute has decided to brighten up the walls by adding some pictures of Bounded Auto-similar Periodic Curves, which are geometric structures usually known as fractals. The director has some great ideas for beautiful fractals, but they are not sure whether these will fit on the walls of the institute.
Since these fractals will be painted all over the walls of the institute, the director has asked you to determine the area of these fractals, so they know exactly how much paint they will need to use for this.
The fractals are constructed from a polyline1 between $(0,0)$ and $(1,0)$. Starting with an equilateral triangle with side length 1ドル,ドル each segment of the boundary is recursively replaced by a scaled and rotated version of the original polyline, so that the endpoints and orientation match.
As an example, consider the first sample case, visualized in Figure F.1. The resulting fractal in this case is called the Koch Snowflake.
Figure F.1: Visualization of the first sample case, with the given polyline on the left and the resulting fractal on the right.
1A polyline is a shape made by connecting a series of straight line segments at their endpoints.
The input consists of:
All floating point numbers consist of exactly 6ドル$ digits behind the decimal point. It is guaranteed that the first point is $(0,0)$ and the last point is $(1,0)$. The resulting fractal converges and does not overlap with itself.
Output the area of the resulting fractal.
Your answer should have an absolute or relative error of at most 10ドル^{-6}$.
5 0.000000 0.000000 0.333333 0.000000 0.500000 0.288675 0.666667 0.000000 1.000000 0.000000
0.692820545
5 0.000000 0.000000 0.200000 0.000000 0.600000 -0.200000 0.500000 0.000000 1.000000 0.000000
0.237360528
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries F번