原文:[LeetCode] Arranging Coins 排列硬币

You have a total of n coins that you want to form in a staircase shape, where every k th row must have exactly k coins. Given n, find the total number of full staircase rows that can be formed. n is ...

2016-11-03 12:22 0 7416 推荐指数:

查看详情

lintcode :Coins in Line II 硬币排成线 II

题目 硬币排成线 II 有 n 个不同价值的硬币排成一条线。两个参赛者轮流从左边依次拿走 1 或 2 个硬币,直到没有硬币为止。计算两个人分别拿到的硬币总价值,价值高的人获胜。 请判定 第一个玩家 是输还是赢? 样例 给定数组 A = [1,2,2 ...

Sat Nov 14 05:41:00 CST 2015 1 2464
[LeetCode] Coin Path 硬币路径

Given an array A (index starts at 1) consisting of N integers: A1, A2, ..., AN and an integer B. ...

Wed Jan 03 22:03:00 CST 2018 1 3857
硬币组合(排列数和组合数)

给定不同面额的硬币 coins 和一个总金额 amount。编写一个函数来计算可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,返回 -1。 示例 1: 输入: coins = [1, 2, 5], amount = 11 输出 ...

Tue Apr 14 07:13:00 CST 2020 0 762
[LeetCode] 518. Coin Change 2 硬币找零 2

You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up ...

Fri Mar 30 15:50:00 CST 2018 0 1144
LeetCode(60): 第k个排列

Medium! 题目描述: 给出集合 [1,2,3,…,n],其所有元素共有 n! 种排列。 按大小顺序列出所有排列情况,并一一标记,当 n = 3 时, 所有排列如下: "123" "132" "213" "231" "312" "321 ...

Thu Jun 07 19:05:00 CST 2018 0 3769
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM