Logo
(追記) (追記ここまで)

32542번 - Fractal Area 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB67201832.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:

  • One line with an integer $n$ (2ドル\leq n\leq 1000$), the number of points defining the polyline.
  • $n$ lines with two floating point numbers $x$ and $y$ (0ドル \leq x \leq 1,ドル $|y| < 0.5$), the coordinates of a point defining the polyline.

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}$.

제한

예제 입력 1

5
0.000000 0.000000
0.333333 0.000000
0.500000 0.288675
0.666667 0.000000
1.000000 0.000000

예제 출력 1

0.692820545

예제 입력 2

5
0.000000 0.000000
0.200000 0.000000
0.600000 -0.200000
0.500000 0.000000
1.000000 0.000000

예제 출력 2

0.237360528

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries F번

  • 문제를 만든 사람: Lammert Westerdijk
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /