POJ 3597 Polygon Division:題目解答源碼

Given a regular polygon, there are numerous ways to divide it into several triangles and/or quadrangles by adding some diagonals that do not properly intersect each other. For example, Figure 4 shows all ten different divisions of a regular pentagon into triangles and quadrangles.

poj_3040desc_0.jpg

Figure 4: Divisions of a regular pentagon into triangles and quadrangles

Given n, the number of sides of the polygon, compute the number of such divisions.

輸入描述

The input contains multiple test cases. Each test case consists of a single integer n (3 ≤ n ≤ 5000) on a separate line. The input ends where EOF is met.

輸出描述

For each test case, print the answer modulo 264 on a separate line.

程序源碼

wKioL1fXr4LgJdWYAAApQ0F1UPg021.png-wh_50

完整的源代碼:http://www.manonggu.com/suancheng/view7477.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章