keepMoving binary tree sequence traversal deformation and minimum dictionary ordered substring with length k

Let's start with sequence traversal. This is a common problem. Print it according to each layer, as follows: For Recommendation in Deep learning QQ Group 277356808 For deep learning QQ Second Group 629530787 I'm here waiting for you 1 - sequence traversal and deformation Sequence traversal is the most intuitive and simplest sequence, that ...

Added by kelvin on Mon, 21 Feb 2022 11:44:53 +0200

[ybt gold medal navigation 2-1-3] [Luogu p4555] longest double palindrome string (two methods)

Longest double palindrome string Title Link: ybt gold navigation 2-1-3 / luogu P4555 General idea of the topic Give you a string and ask you to find the longest substring so that it is composed of two palindrome strings. thinking First, let's see the palindrome string. Let's run a Manacher first. Then we'll think about what to do. First, ...

Added by Ward on Fri, 18 Feb 2022 14:17:09 +0200

P6775-[NOI2020] making dishes [greedy, dp]

Topic Title Link: https://www.luogu.com.cn/problem/P6775 General idea of the topic n n n raw materials, No i i i have d ...

Added by Xproterg^vi on Mon, 24 Jan 2022 07:06:50 +0200

Section DP

Title Link https://codeforces.com/problemset/problem/149/D meaning of the title Give a matching bracket string. Each bracket can be dyed a and b or not. Requirements: Each matching bracket needs to have and only one coloringAdjacent brackets shall not be dyed in the same color, but neither Number of dyeing schemes thinking Note that we a ...

Added by mizz key_me on Fri, 21 Jan 2022 03:25:14 +0200

Digital statistics DP

preface Review the content of the basic course of acwing algorithm. This article is to explain the basic algorithm: dynamic programming - digital statistics DP. About time complexity: bloggers are not very good at computing at present. They will make up for it in the future. 1, Dynamic programming Dynamic Programming (DP) is the proc ...

Added by phait on Sun, 16 Jan 2022 21:54:13 +0200

Introduction to slope optimization dp

Recommend 2 Blogs: Slope optimization DP detailed explanation - Zhihu Slope optimization OI Wiki Example 1: P5785 [SDOI2012] task arrangement First, we can define violence dp f [ i ] [ j ...

Added by hearn on Fri, 14 Jan 2022 06:25:01 +0200

CF936D World of Tank

1, Title Click here to see the question There is a grid diagram of \ (2\times n \), and there are \ (m_1+m_2 \) obstacles in the upper and lower lines respectively. Now you drive the tank from \ ((1,0) \) to \ ((1,n+1) \) or \ ((2,n+1) \), you can choose whether to wrap the line every second (the column remains unchanged), then choose whether t ...

Added by Grimloch on Sat, 08 Jan 2022 10:33:08 +0200

Special test mathematics 3

A. Solving equation It is easy to do without considering the two restrictions. Use the board inserting method to divide \ (m \) balls into \ (n \) piles It's \ (\ binom{m-1}{n-1} \) The second limit is greater than or equal to, so you can allocate \ (a_i-1 \) to these numbers first The first restriction is not easy to do directly, so consider i ...

Added by froggie81 on Fri, 07 Jan 2022 13:28:39 +0200

String A - > string B example: shortest editing distance, optimal inclusion (linear DP)

AcWing 902. Minimum edit distance Given the two strings A and B, now you want to change A into B through several operations. The available operations are: Delete – deletes A character from string A. Insert – inserts A character somewhere in string A. Replace – replaces one character in string A with another. Now please find ...

Added by planetsim on Tue, 04 Jan 2022 07:24:26 +0200

P4769 [NOI2018] bubble sort

Gossip: I guessed a conclusion when I was doing this problem. The number of longest ascending subsequences cannot exceed two. At that time, I felt it was false... First of all, if a sequence can satisfy the lower bound, then each element in it must only move in the direction of its target. In addition, the movement of a number is determined by ...

Added by Nik on Tue, 04 Jan 2022 04:47:13 +0200