<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[NP_hard的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/NP_hard</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; NP_hard]]></copyright><item><title><![CDATA[每日一题 day59 (Dp topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123860285</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123860285</guid><author>NP_hard</author><pubDate>Wed, 30 Mar 2022 23:30:06 +0800</pubDate><description><![CDATA[文章目录problemapproach 1 `recursive TLE`approach 2 `dp`
problem
377. Combination Sum IV
Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.
The test cases are generated so tha]]></description><category></category></item><item><title><![CDATA[每日一题 day 58(DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123724918</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123724918</guid><author>NP_hard</author><pubDate>Fri, 25 Mar 2022 00:04:09 +0800</pubDate><description><![CDATA[文章目录problemwrong approachapproach `memorize dp`
problem
518. Coin Change 2
You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.
Return the number of combinations that]]></description><category></category></item><item><title><![CDATA[每日一题 day 57 (DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123698839</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123698839</guid><author>NP_hard</author><pubDate>Thu, 24 Mar 2022 00:15:48 +0800</pubDate><description><![CDATA[文章目录problem `classical bag problem`wrong approach `59/188， Greedy`wrong approach 2 `TLE, recursive`appraoch 3 `memorize dp`approach `bag problem , dp`
problem classical bag problem
322. Coin Change
You are given an integer array coins representing coins of]]></description><category></category></item><item><title><![CDATA[蓝桥杯 时间显示]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123697649</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123697649</guid><author>NP_hard</author><pubDate>Wed, 23 Mar 2022 21:56:27 +0800</pubDate><description><![CDATA[文章目录题目代码
题目

纯送分题


代码
#include&lt;iostream&gt;
#include&lt;stdio.h&gt;&gt;
using namespace std;

int main()
{
	long long x;
	cin &gt;&gt; x;
	int mods = 24*60*60*1000;//1 day's ms
	int mods_h = 60*60*1000;//1 hour's ms
	int mods_m = 60*1000;
	int mods_s =]]></description><category></category></item><item><title><![CDATA[蓝桥杯 杨辉三角]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123670878</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123670878</guid><author>NP_hard</author><pubDate>Tue, 22 Mar 2022 20:41:01 +0800</pubDate><description><![CDATA[文章目录题目代码
题目
参考链接

代码
#include &lt;iostream&gt;
#include &lt;cstring&gt;
#include &lt;algorithm&gt;
using namespace std;
typedef long long LL;
int n;
LL C(int a, int b)   //计算C（a，b）
{
    
    LL res = 1;
    for(int i = a, j = 1; j &lt;= b; i --, j ++)
   ]]></description><category></category></item><item><title><![CDATA[每日一题 day 56（DP topic）]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123621435</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123621435</guid><author>NP_hard</author><pubDate>Sun, 20 Mar 2022 21:22:03 +0800</pubDate><description><![CDATA[文章目录problemapproach `DP`approach `shorter code`wrong approach
problem
1143. Longest Common Subsequence
Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.
A subsequence of a]]></description><category></category></item><item><title><![CDATA[每日一题 day 55(DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123587212</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123587212</guid><author>NP_hard</author><pubDate>Fri, 18 Mar 2022 23:55:22 +0800</pubDate><description><![CDATA[文章目录problemapproach 1approach 2 `shorter code`
problem
392. Is Subsequence
Given two strings s and t, return true if s is a subsequence of t, or false otherwise.
A subsequence of a string is a new string that is formed from the original string by deleting ]]></description><category></category></item><item><title><![CDATA[每日一题 day 54 (DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123546625</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123546625</guid><author>NP_hard</author><pubDate>Thu, 17 Mar 2022 15:15:19 +0800</pubDate><description><![CDATA[文章目录problemapproach 1 `Brute force`approach 3 `Greedy`
problem
376. Wiggle Subsequence
A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) m]]></description><category></category></item><item><title><![CDATA[OS笔记1 进程与线程]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123535660</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123535660</guid><author>NP_hard</author><pubDate>Wed, 16 Mar 2022 21:37:48 +0800</pubDate><description><![CDATA[文章目录前言进程的基本概念进程的属性内存模型的中的进程映像线程的基本概念进程间的组织关系进程与线程
前言
操作系统浩如烟海，而进程是OS中相当重要的一个概念，在阅读了lqm老师的进程控制的pdf之后，我打算进行一些自我总结与提炼，若有笔误，恳请指正。
进程的基本概念
进程的属性
一个进程含有多个属性，进程在linux系统中有一个结构体的定义，而这个结构体里包含了很多属性，主要有：

进程控制块 PCB  （task_tsruct ）（ 在内核空间中 ）（线程也有PCB！）
内存描述符 mm_struct （]]></description><category></category></item><item><title><![CDATA[每日一题 day 53 （DP topic）]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123521371</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123521371</guid><author>NP_hard</author><pubDate>Wed, 16 Mar 2022 11:46:26 +0800</pubDate><description><![CDATA[文章目录problemapproach 1 `DP`approach 2 `Greedy with Binary search`approach 3 ` Binary Indexed Tree` `others approach`
problem
300. Longest Increasing Subsequence
Given an integer array nums, return the length of the longest strictly increasing subsequence.
A]]></description><category></category></item><item><title><![CDATA[字符串DP问题]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123496825</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123496825</guid><author>NP_hard</author><pubDate>Tue, 15 Mar 2022 10:57:13 +0800</pubDate><description><![CDATA[文章目录前言例题1例题2
前言
对于一些字符串问题，比如求一串字符中最长的回文串，或者是一些回文串的变种问题，我们一般可以使用一个二维的DP数组来保存计算的结果，从而减少计算量，下面我用两个例题来解释
例题1
例题的链接
例题2
516. Longest Palindromic Subsequence
给定一个字符串s，找出s中最长的回文子序列的长度。
子序列是一个序列，可以通过删除部分或不删除元素而从另一个序列派生，而不改变其余元素的顺序。
我们可以将一个字符串的任意字串用一个二维DP数组来表示，比如s[]]></description><category></category></item><item><title><![CDATA[每日一题 day 52 (DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123495565</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123495565</guid><author>NP_hard</author><pubDate>Tue, 15 Mar 2022 10:13:25 +0800</pubDate><description><![CDATA[文章目录problemapproach 1
problem
516. Longest Palindromic Subsequence
Given a string s, find the longest palindromic subsequence’s length in s.
A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without chang]]></description><category></category></item><item><title><![CDATA[每日一题 day 51 (DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123489940</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123489940</guid><author>NP_hard</author><pubDate>Mon, 14 Mar 2022 22:19:50 +0800</pubDate><description><![CDATA[文章目录problemapproach 1
problem
221. Maximal Square
Given an m x n binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.
Example 1:

Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","]]></description><category></category></item><item><title><![CDATA[二维DP问题]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123457205</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123457205</guid><author>NP_hard</author><pubDate>Sun, 13 Mar 2022 12:38:49 +0800</pubDate><description><![CDATA[文章目录前言小技巧例题 1方法一 求组合数方法二 动态规划例题 2方法一 dp例题 3方法一 dp
前言
我们经常会碰到二维DP问题，比如给你一张地图（一般是二维矩阵），让你计算出从地图的左上端走到右下端的路径有多少条 / 最短的路径之和，这种问题一般会被限制运动的空间（至少我现在所碰到的题目），一般是只能向下和向右移动。
我对dp问题理解不深，对于二维dp问题我的理解就是找出最优子结构（递推方程）之后，用一个二维数组来保存历史状态就能解决问题了
小技巧
一般这种问题很容易被矩阵上边和左边这两条bounda]]></description><category></category></item><item><title><![CDATA[每日一题 day 50(DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123456532</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123456532</guid><author>NP_hard</author><pubDate>Sun, 13 Mar 2022 11:58:30 +0800</pubDate><description><![CDATA[文章目录problemapproach 1`DP`approach 2 `DP less space`
problem
64. Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
Note: You can only move ]]></description><category></category></item><item><title><![CDATA[每日一题 day 49 (DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123443383</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123443383</guid><author>NP_hard</author><pubDate>Sat, 12 Mar 2022 16:21:50 +0800</pubDate><description><![CDATA[文章目录problemapproach 1 `DP`approach 2 `DP merge two loop`approach 3 `others dp`approach 4 `others dp, less space`
problem
63. Unique Paths II
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).
The robot can only]]></description><category></category></item><item><title><![CDATA[求组合数算法（大数板子）]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123429653</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123429653</guid><author>NP_hard</author><pubDate>Fri, 11 Mar 2022 17:12:17 +0800</pubDate><description><![CDATA[代码
long C(int m, int n) {
    if(m &lt; n) swap(m, n);
    long res = 1;
    for(int i = m+1, j=1; i &lt;= m+n; i++, j++){       // Instead of taking factorial, keep on multiply &amp; divide
        res *= i;
        res /= j;
    }
    return res;
}

例题
链]]></description><category></category></item><item><title><![CDATA[每日一题 day48 （DP topic）]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123428340</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123428340</guid><author>NP_hard</author><pubDate>Fri, 11 Mar 2022 17:09:27 +0800</pubDate><description><![CDATA[文章目录problemapproach `permutation`approach 1 `DP`approach 2 `DP improve`
problem
62. Unique Paths
There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner]]></description><category></category></item><item><title><![CDATA[每日一题 day 47 (DP topic)]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123398666</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123398666</guid><author>NP_hard</author><pubDate>Thu, 10 Mar 2022 12:42:19 +0800</pubDate><description><![CDATA[文章目录problemapproach
problem
304. Range Sum Query 2D - Immutable
Given a 2D matrix matrix, handle multiple queries of the following type:

Calculate the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and low]]></description><category></category></item><item><title><![CDATA[数组前缀和解决二维DP问题]]></title><link>https://blog.youkuaiyun.com/NP_hard/article/details/123378314</link><guid>https://blog.youkuaiyun.com/NP_hard/article/details/123378314</guid><author>NP_hard</author><pubDate>Wed, 09 Mar 2022 15:11:58 +0800</pubDate><description><![CDATA[文章目录用法例题1
用法

例题1
题目链接

]]></description><category></category></item></channel></rss>