最新 最热

Codeforces Round #547 (Div. 3)G. Privatization of Roads in Treeland

Treeland consists of n cities and n−1 roads. Each road is bidirectional and connects two distinct cities. From any city you can get to any other city by roads. ...

2020-09-28
1

Codeforces Round #547 (Div. 3)E. Superhero Battle

A superhero fights with a monster. The battle consists of rounds, each of which lasts exactly nn minutes. After a round ends, the next round starts immediately....

2020-09-28
1

动态规划入门_钱币兑换问题

首先递推公式 : 钱币面值 从 1,一直遍历到 n , 然后兑换的面值从 j=1 到 j 等于最大的面值, 面对 第 i种面值的硬币,有两种选择,不选则当前硬币面值的所有情况 加上选择当前面值的...

2020-09-28
1

Codeforces Round #547 (Div. 3)C. Polycarp Restores Permutation

An array of integers p1,p2,…,pnp1,p2,…,pn is called a permutation if it contains each number from 11 to nn exactly once. For example, the following arrays are p...

2020-09-28
0

Array - 55. Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array.

2020-09-23
1

Array - 309. Best Time to Buy and Sell Stock with Cooldown

Say you have an array for which the ith element is the price of a given stock on day i.

2020-09-23
1

Array - 59. Spiral Matrix II

Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.

2020-09-23
1

Dynamic Programming - 279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.

2020-09-23
1

Dynamic Programming - 322. Coin Change

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

2020-09-23
1

Dynamic Progamming - 198. House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...

2020-09-23
1