自然数的拆分
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
任何一个大于1的自然数n(n≤20),总可以拆分成若干个小于n的自然数之和。
当n=7共14种拆分方法:
7=1+1+1+1+1+1+1
7=1+1+1+1+1+2
7=1+1+1+1+3
7=1+1+1+2+2
7=1+1+1+4
7=1+1+2+3
7=1+1+5
7=1+2+2+2
7=1+2+4
7=1+3+3
7=1+6
7=2+2+3
7=2+5
7=3+4
total=14
输入
输入n。
输出
按字典序输出具体的方案。
样例
7
7=1+1+1+1+1+1+1
7=1+1+1+1+1+2
7=1+1+1+1+3
7=1+1+1+2+2
7=1+1+1+4
7=1+1+2+3
7=1+1+5
7=1+2+2+2
7=1+2+4
7=1+3+3
7=1+6
7=2+2+3
7=2+5
7=3+4
周日9:00 阶段测试24-12-28
- Status
- Done
- Rule
- OI
- Problem
- 6
- Start at
- 2024-12-28 13:00
- End at
- 2025-1-5 21:00
- Duration
- 200 hour(s)
- Host
- Partic.
- 10