<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Dynamic Programming on Chunixz情报中心</title>
    <link>https://chunixz.github.io/tags/dynamic-programming/</link>
    <description>Recent content in Dynamic Programming on Chunixz情报中心</description>
    <image>
      <title>Chunixz情报中心</title>
      <url>https://chunixz.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url>
      <link>https://chunixz.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link>
    </image>
    <generator>Hugo -- gohugo.io</generator><atom:link href="https://chunixz.github.io/tags/dynamic-programming/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Algorithms DP-01 LPS</title>
      <link>https://chunixz.github.io/posts/2019-03-21-1/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://chunixz.github.io/posts/2019-03-21-1/</guid>
      <description>Dynamic Programming Leetcode 5. Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
Example 1:
Input: &amp;#34;babad&amp;#34; Output: &amp;#34;bab&amp;#34; Note: &amp;#34;aba&amp;#34; is also a valid answer. Example 2:
Input: &amp;#34;cbbd&amp;#34; Output: &amp;#34;bb&amp;#34; 解题思路 1. 根据回文类型 将回文串分为三种：
第一种是对称式回文串，比如：acddca 第二种是重复式的，比如：aaaaa 第三种是夹心饼干使的：acbbca 针对这三种情况来分析
C代码
2. 马拉车（Maracher）算法 马拉车（Maracher）算法
这道题用c语言的马拉车算法反而更耗时，因为需要频繁地申请内存，可能其他语言会更加高效。
C代码</description>
    </item>
    
    <item>
      <title>Algorithms Q &amp; A</title>
      <link>https://chunixz.github.io/posts/2019-03-21-2/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://chunixz.github.io/posts/2019-03-21-2/</guid>
      <description>Q 每瓶啤酒2元，2个空酒瓶或4个瓶盖可换1瓶啤酒。先付钱再喝酒，不能赊账，请实现一个函数计算N元钱最多可喝多少瓶啤酒?
A int getSum(int n) { if(n &amp;lt; 2) return 0; int x = n / 2; int y = n / 2; int sum = x; //printf(&amp;#34;%d %d %d\n&amp;#34;, x, y, sum); while (x &amp;gt;= 2 || y &amp;gt;= 4) { while(x &amp;gt;= 2) { sum += 1; x -= 2; x += 1; y += 1; } while(y &amp;gt;= 4) { sum += 1; x += 1; y -= 4; y += 1; } } //printf(&amp;#34;%d\n&amp;#34;, sum); return sum; } </description>
    </item>
    
  </channel>
</rss>
