1182. Convex Polygon division, 1182 Division

Source: Internet
Author: User

1182. Convex Polygon division, 1182 Division

In a convex n-edge shape, the question describes how many splitting schemes can be used to split n-edge shapes into several triangles through the diagonal lines that do not intersect in the n-edge shape.
For example, Pentagon has the following five sharding schemes.
Enter an integer n (3 <=n <= 32) in the first line ). Output a number to indicate the total number of partitioning schemes. Sample Input
5
Sample output
5
Data range: 3 <= n <= 32
1 # include <iostream> 2 using namespace std; 3 long int f [1001]; 4 int main () 5 {6 int n; 7 f [2] = 1; 8 f [3] = 1; 9 cin> n; 10 // n = n + 2; 11 for (int I = 4; I <= n; I ++) 12 {13 for (int j = 2; j <= n-1; j ++) 14 {15 f [I] = f [j] * f [I-j + 1] + f [I]; 16} 17} 18 cout <f [n]; 19 return 0; 20}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.