区间型动态规划
文章平均质量分 91
flyatcmu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
区间型动态规划总结
区间型动态规划,都是dp[i][j]由小的区间先计算,然后计算大的区间得到,模板就是:for(int len = 2; len <= n; len++) { for(int i = 0; i + len - 1 < n; i++) { int j = i + len - 1;很多题都可以用这个模板写;Longest Palindromic Subsequence思路:区间型动态规划,f[i][j]表示s[i] ~ s[j]之...原创 2020-09-05 10:01:53 · 1348 阅读 · 0 评论 -
Longest Palindromic Subsequence
Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is1000.ExampleExample1Input: "bbbab"Output: 4Explanation:One possible l...原创 2019-12-19 12:33:42 · 394 阅读 · 0 评论 -
Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length ofS is 1000, and there exists one unique longest palindromic substring.思路:Palindrome分奇数和偶数个,像aba...原创 2014-02-04 13:13:39 · 683 阅读 · 0 评论 -
Predict the Winner
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player picks a number, that number will not be available for the next原创 2020-06-11 04:03:45 · 249 阅读 · 0 评论 -
[leetcode] Stone Game
Alex and Lee play a game with piles of stones. There are an even number ofpilesarranged in a row, and each pile has a positive integer number of stonespiles[i].The objective of the game is to end with the moststones. The total number of stones is o...原创 2020-06-11 03:30:17 · 395 阅读 · 0 评论
分享