原文:[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