NP_hard
码龄5年
关注
提问 私信
  • 博客:265,949
    社区:30
    265,979
    总访问量
  • 177
    原创
  • 822,892
    排名
  • 3,567
    粉丝
  • 48
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:上海市
  • 加入CSDN时间: 2019-12-04
博客简介:

NP_hard的博客

查看详细资料
个人成就
  • 获得266次点赞
  • 内容获得109次评论
  • 获得1,018次收藏
  • 代码片获得2,490次分享
创作历程
  • 74篇
    2022年
  • 87篇
    2021年
  • 23篇
    2020年
成就勋章
TA的专栏
  • Blue Bridge Cup
    2篇
  • Algorithm design
    6篇
  • Accumulation of bug
    4篇
  • LeetCode Learning
    60篇
  • Sampling techniques
    5篇
  • Computer Architecture
    1篇
  • Data Base
    3篇
  • Computer Vision
    6篇
  • Operating System
    4篇
  • Mathematical modeling
    9篇
  • Random Process | Optimization
    9篇
  • Big Data Processing & Analysis
    10篇
  • Machine learning
    29篇
  • Java
    3篇
  • Data Structure
    20篇
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

每日一题 day59 (Dp topic)

文章目录problemapproach 1 `recursive TLE`approach 2 `dp`problem377. Combination Sum IVGiven 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
原创
发布博客 2022.03.30 ·
532 阅读 ·
0 点赞 ·
1 评论 ·
0 收藏

每日一题 day 58(DP topic)

文章目录problemwrong approachapproach `memorize dp`problem518. Coin Change 2You 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
原创
发布博客 2022.03.25 ·
535 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 57 (DP topic)

文章目录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 problem322. Coin ChangeYou are given an integer array coins representing coins of
原创
发布博客 2022.03.24 ·
683 阅读 ·
0 点赞 ·
2 评论 ·
0 收藏

蓝桥杯 时间显示

文章目录题目代码题目纯送分题代码#include<iostream>#include<stdio.h>>using namespace std;int main(){ long long x; cin >> 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 =
原创
发布博客 2022.03.23 ·
1037 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

蓝桥杯 杨辉三角

文章目录题目代码题目参考链接代码#include <iostream>#include <cstring>#include <algorithm>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 <= b; i --, j ++)
原创
发布博客 2022.03.22 ·
615 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 56(DP topic)

文章目录problemapproach `DP`approach `shorter code`wrong approachproblem1143. Longest Common SubsequenceGiven 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
原创
发布博客 2022.03.20 ·
433 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 55(DP topic)

文章目录problemapproach 1approach 2 `shorter code`problem392. Is SubsequenceGiven 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
原创
发布博客 2022.03.18 ·
341 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 54 (DP topic)

文章目录problemapproach 1 `Brute force`approach 3 `Greedy`problem376. Wiggle SubsequenceA wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) m
原创
发布博客 2022.03.17 ·
507 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

OS笔记1 进程与线程

文章目录前言进程的基本概念进程的属性内存模型的中的进程映像线程的基本概念进程间的组织关系进程与线程前言操作系统浩如烟海,而进程是OS中相当重要的一个概念,在阅读了lqm老师的进程控制的pdf之后,我打算进行一些自我总结与提炼,若有笔误,恳请指正。进程的基本概念进程的属性一个进程含有多个属性,进程在linux系统中有一个结构体的定义,而这个结构体里包含了很多属性,主要有:进程控制块 PCB (task_tsruct )( 在内核空间中 )(线程也有PCB!)内存描述符 mm_struct (
原创
发布博客 2022.03.16 ·
440 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

每日一题 day 53 (DP topic)

文章目录problemapproach 1 `DP`approach 2 `Greedy with Binary search`approach 3 ` Binary Indexed Tree` `others approach`problem300. Longest Increasing SubsequenceGiven an integer array nums, return the length of the longest strictly increasing subsequence.A
原创
发布博客 2022.03.16 ·
806 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

字符串DP问题

文章目录前言例题1例题2前言对于一些字符串问题,比如求一串字符中最长的回文串,或者是一些回文串的变种问题,我们一般可以使用一个二维的DP数组来保存计算的结果,从而减少计算量,下面我用两个例题来解释例题1例题的链接例题2516. Longest Palindromic Subsequence给定一个字符串s,找出s中最长的回文子序列的长度。子序列是一个序列,可以通过删除部分或不删除元素而从另一个序列派生,而不改变其余元素的顺序。我们可以将一个字符串的任意字串用一个二维DP数组来表示,比如s[
原创
发布博客 2022.03.15 ·
344 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 52 (DP topic)

文章目录problemapproach 1problem516. Longest Palindromic SubsequenceGiven 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
原创
发布博客 2022.03.15 ·
250 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 51 (DP topic)

文章目录problemapproach 1problem221. Maximal SquareGiven 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","
原创
发布博客 2022.03.14 ·
659 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

二维DP问题

文章目录前言小技巧例题 1方法一 求组合数方法二 动态规划例题 2方法一 dp例题 3方法一 dp前言我们经常会碰到二维DP问题,比如给你一张地图(一般是二维矩阵),让你计算出从地图的左上端走到右下端的路径有多少条 / 最短的路径之和,这种问题一般会被限制运动的空间(至少我现在所碰到的题目),一般是只能向下和向右移动。我对dp问题理解不深,对于二维dp问题我的理解就是找出最优子结构(递推方程)之后,用一个二维数组来保存历史状态就能解决问题了小技巧一般这种问题很容易被矩阵上边和左边这两条bounda
原创
发布博客 2022.03.13 ·
2721 阅读 ·
1 点赞 ·
0 评论 ·
6 收藏

每日一题 day 50(DP topic)

文章目录problemapproach 1`DP`approach 2 `DP less space`problem64. Minimum Path SumGiven 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
原创
发布博客 2022.03.13 ·
273 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 49 (DP topic)

文章目录problemapproach 1 `DP`approach 2 `DP merge two loop`approach 3 `others dp`approach 4 `others dp, less space`problem63. Unique Paths IIA robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only
原创
发布博客 2022.03.12 ·
308 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

求组合数算法(大数板子)

代码long C(int m, int n) { if(m < n) swap(m, n); long res = 1; for(int i = m+1, j=1; i <= m+n; i++, j++){ // Instead of taking factorial, keep on multiply & divide res *= i; res /= j; } return res;}例题链
原创
发布博客 2022.03.11 ·
272 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day48 (DP topic)

文章目录problemapproach `permutation`approach 1 `DP`approach 2 `DP improve`problem62. Unique PathsThere 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
原创
发布博客 2022.03.11 ·
343 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

每日一题 day 47 (DP topic)

文章目录problemapproachproblem304. Range Sum Query 2D - ImmutableGiven 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
原创
发布博客 2022.03.10 ·
175 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

数组前缀和解决二维DP问题

文章目录用法例题1用法例题1题目链接
原创
发布博客 2022.03.09 ·
225 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多