Running in the tree [Eulerian sequence] [Conclusion]
>Link
ybtoj running in trees
>Description
Xiao A will run on A rooted tree with 1 as the root and N nodes every day. At the beginning, each node has an obstacle. Each obstacle will move periodically in the subtree with the initial point as the root according to the order of depth first, and only one edge will be moved per unit time. ...
Posted by demonicfoetus on Mon, 08 Nov 2021 17:47:46 -0800
Analysis of leetcode problem solving ideas 839 - 845 questions
Similar string Give you a list of strings strs. Each string in the list is an alphabetic word for all other strings in strs. How many similar string groups are there in strs?
Using the idea of joint search set, the string array is transformed into a graph to find the connected edge
class Solution {
public:
vector<int> f;
int fi ...
Posted by sonicfusion on Mon, 08 Nov 2021 13:02:00 -0800
LeetCode 2065. Maximize the path value in a graph
Here's an undirected picture for you Figure with n Nodes, node number from 0 To n - 1 (both included). And give you a subscript from 0 Starting integer array values , among values[i] It's number I Value of nodes . And give you a subscript from 0 Starting 2D inte ...
Posted by pixelsoul on Mon, 08 Nov 2021 12:43:36 -0800
leetcode299 - brush the question file every day
You are playing balls and cows with your friends. The rules of the game are as follows:
Write a secret number and ask your friend to guess what the number is. Every time a friend guesses, you will give him a hint containing the following information:
Guess how many digits in the number belong to the number and the exact position (called " ...
Posted by stenk on Mon, 08 Nov 2021 12:41:16 -0800
Algorithm design and analysis course - Chapter 4 greedy algorithm
Basic concepts of greedy algorithm
"First of all, it should be emphasized that the premise of 01 knapsack problem is that each item has only two states: selected and not selected. Part of an item cannot be loaded into the knapsack. This is the meaning of 01 in 01 knapsack. If a part of an item can be ...
Posted by firecat318 on Mon, 08 Nov 2021 05:48:38 -0800
Recursion and recursion
Recursion and recursion (2)
1.Simple Fibonacci
The following sequence 0 1 1 2 3 5 8 13 21... Is called Fibonacci sequence.
This sequence starts with Item 3, and each item is equal to the sum of the first two items.
Enter an integer N, please output the first N items of this sequence.
Input format An integer N.
Output format Output the fir ...
Posted by Ristiisa on Sun, 07 Nov 2021 22:31:43 -0800
Learning summary of the new semester 5
This week, I continued to do questions and found many problems and deficiencies that need to be improved. P1064 [NOIP2006 improvement group] Jin Ming's budget plan This is a knapsack problem, but some changes have been added on the basis of the original complete knapsack: each item has at most 2 accessories. Only by adding this item can its acc ...
Posted by sumitnice@rediffmail.com on Sun, 07 Nov 2021 14:56:50 -0800
Leetcode 5921. Maximize the path value anonymous function dfs or bfs with bitset in a graph
5921. Maximize the path value in a graph
meaning of the title
Here is an undirected graph with n nodes numbered from 0 to n - 1 (both included). At the same time, give you an integer array values with subscript starting from 0, where values[i] is the value of the ith node. At the same time, give you a two-dimensional integer array edges with su ...
Posted by balacay on Sun, 07 Nov 2021 13:56:59 -0800
Learning notes - Java design pattern - structured pattern 3
Java design principles & & patterns learning notes
explain
Recently, the sweeper decided to integrate the design mode learned at the beginning of the year. First, it is used for review and consolidation. Second, he also hopes to encourage his integration with students in need.
In the course of learning, the main reference of the sweeper ...
Posted by grigori on Sun, 07 Nov 2021 11:28:12 -0800
Weekend Summary 4 (Basic Common Knowledge)
This week is also not much, no week I am satisfied with, no sense of knowledge to enrich, feel pushed by the task, plan the weekend two days to brush topics and organize evening homework, but really not as good as to do it in advance. On Sunday, I temporarily added two thought reports, a love letter, and I was very speechless. I hope I can ...
Posted by lunarul on Sun, 07 Nov 2021 08:27:37 -0800