摘要: 题目描述把 M 个同样的苹果放在 N 个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?注意:5、1、1 和 1、5、1 是同一种分法,即顺序无关。 输入描述:输入包含多组数据。 每组数据包含两个正整数 m和n(1≤m, n≤20)。 输出描述:对应每组数据,输出一个整数k,表示有k种不 阅读全文
posted @ 2017-04-19 20:59 蓝鲸王子 阅读(608) 评论(0) 推荐(0) 编辑
摘要: 题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can yo 阅读全文
posted @ 2017-04-19 20:57 蓝鲸王子 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 题目: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the followin 阅读全文
posted @ 2017-04-19 17:09 蓝鲸王子 阅读(2161) 评论(0) 推荐(0) 编辑