- 博客(5)
- 收藏
- 关注

原创 C语言 划分整数
题目描述 将整数n分成k份,且每份不能为空,任意两种分法不能相同(不考虑顺序)。例如:n=7,k=3,下面三种分法被认为是相同 的。 1,1,5; 1,5,1; 5,1,1; 问有多少种不同的分法。 输入 输入n,k (6<n≤200,2≤k≤6) 输出 输出一个整数,即不同的分法。 样例输入 7 3 样例输出 4 提示 ...
2018-08-05 08:49:42
888
原创 零件分组
题目描述 某公司生产了一些标准部件,这些部件有固定的尺寸(xi)和重量(yi)。为了更好地加工它们,需要分组,使每一组的部件都能排成一个尺寸和重量都不下降(若i<j,则xi<=xj,yi<=yj)的序列。请问至少要分成几组? 输入 第一行为一个整数N(N<=1000),表示部件的个数。第二行有N对正整数,每对正整数表示这些部件的尺寸和重...
2018-08-18 19:14:56
2076
原创 大树和小树
题目描述 给定一棵树,输出树的根root,孩子最多的结点max以及他的孩子 输入 第一行:n(结点数<=100),m(边数<=200)。 以下m行;每行两个结点x和y, 表示y是x的孩子(x,y<=1000)。 输出 第一行:树根:root。 第二行:孩子最多的结点max。 第三行:max的孩子。 样例输入 8 7 4 1 4 2 1 3 1 5 2 6 ...
2018-08-08 09:07:51
309
原创 UVa1200 Printer Queue C语言
The only printer in the computer science students’ union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in the printer queue and you may have to wait for hours to get ...
2018-07-28 10:00:21
263
原创 Cube painting,UVa 253
We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube’s faces are numbered as in Figure 1. Si...
2018-07-22 15:12:00
275
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人