编程介的小学生 2019-09-14 21:38 采纳率: 20.5%
浏览 64

Young 怎么用程序来实现的

Description

Consider m natural numbers n1, n2, ..., nm with the property n1 >= n2 >= ... >= nm > 0.

We define a Young table as an arrangement in a table of n1 + n2 + ... + nm natural numbers (bigger than 0 and any two different), so that the ith line has ni elements (1 <= i <= m) in ascending order from left to right, and the elements from the same column are in ascending order from bottom to top.

An example of Young table for m = 4, n1 = 6, n2 = 4, n3 = 4, n4 = 1 is the following:
1 2 5 9 10 15

3 6 7 13

4 8 12 14

11

Given n1, n2, ..., nm determine the number of Young tables containing the elements 1, 2, ..., n1+n2+...+nm.
Input

The input has the stucture:

on the first line is: the natural number m (1 <= m <= 20);
on the second line are: the numbers n1, n2, ..., nm separated by a space (n1 <= 12).
Output

The output will contain the number of Young tables that can be built.
Sample Input

2
3 2
Sample Output

5

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 关于#python#的问题:自动化测试