-->
当前位置:首页 > 题库

PROGRAMMING:Set partition

Luz5年前 (2021-05-10)题库471
When n = 4, the set {1,2,3,4} can be divided into 15 different nonempty subsets as follows:
```
{{1},{2},{3},{4}},
{{1,2},{3},{4}},
{{1,3},{2},{4}},
{{1,4},{2},{3}},
{{2,3},{1},{4}},
{{2,4},{1},{3}},
{{3,4},{1},{2}},
{{1,2},{3,4}},
{{1,3},{2,4}},
{{1,4},{2,3}},
{{1,2,3},{4}},
{{1,2,4},{3}},
{{1,3,4},{2}},
{{2,3,4},{1}},
{{1,2,3,4}}
```
How many nonempty subsets can the set of n elements {1,2,..., n} be divided into?
###Input format:
A positive integer n
###Output format:
A number that represents the number of nonempty subsets that can be divided by the set of n elements
###Input example:
```in
five
```
###Output example:
```out
fifty-two
```






answer:If there is no answer, please comment