Efficient multi-dimensional spatial point index algorithm -- Geohash and Google S2

thank Efficient multi-dimensional spatial point index algorithm -- Geohash and Google S2 (halfrost.com) The author of Reprint only records the content for learning purposes   Introduction Every night we work overtime to go home, we may use didi or share a bike. Open the app and you will see the following interface: The app interface w ...

Posted by cdog5000 on Mon, 17 Jan 2022 18:14:22 +0100

Special topic of mathematics in HENAU winter camp

Title Link: Portal Title password: 202201150000 Data connection: Counting Inverse element Inclusion exclusion principle Extended Euclid Learning the game of taking stones in game theory Title Content: Here is the reference mathematical problem A - A^B Mod C Idea: this topic can think of violence first, but the data is too large, s ...

Posted by sarah on Mon, 17 Jan 2022 05:12:14 +0100

[matrix continued multiplication] "dynamic programming" -- algorithm design and analysis (Fifth Edition)

1, Algorithm requirements Given n matrices {A, A, A,,..., An}, where Ai and Ai + 1 (I = 1, 2,..., n-1) are multiplicative. The order of matrix multiplication is expressed by the method of adding brackets. The calculation amount (multiplication times) is different in different calculation orders. Find A method of adding brackets to minimi ...

Posted by scept1c on Sun, 16 Jan 2022 04:02:16 +0100

D. Binary Spiders (thinking + dictionary tree)

D. Binary Spiders [Link](Problem - D - Codeforces) meaning of the title Here you are n n n numbers and one k k k. How many numbers can you choose at most and meet the XOR between any ...

Posted by titel on Thu, 13 Jan 2022 14:10:09 +0100

[Leetcode] [learning plan] [depth first search] maximum area of the island

Title Source: https://leetcode-cn.com/problems/max-area-of-island/ Original solution: https://leetcode-cn.com/problems/max-area-of-island/solution/biao-zhun-javadong-tai-gui-hua-jie-fa-100-by-mark-/ Maximum area of the island Give you a binary matrix grid of size m x n.An island is a combination of some adjacent 1s (representing la ...

Posted by starphp on Thu, 13 Jan 2022 08:42:27 +0100

CF721C Journey problem solution

First of all, it can be found that this problem is actually similar to a knapsack problem on DAG. Then we have an obvious approach: set up f [ v ] [ t ] ...

Posted by prashanth on Wed, 12 Jan 2022 03:57:20 +0100

1182. Minimum distance from target color

1182. Minimum distance from target color Give you an array of colors, which has 1, 2 and 3 colors. We need to perform some queries on colors, where each item to be queried is composed of two integers i and c. Now please help design an algorithm to find the shortest distance from index i to the element with target color c. If no solution exi ...

Posted by yhchan on Sun, 09 Jan 2022 00:21:42 +0100

Algorithm design and analysis training

Training documents can also be obtained directly at the end of the text Algorithm design and analysis training 1. Title 0-1 knapsack problem 2. Purpose The purpose of course design is to train students to flexibly apply the learned data structure knowledge and independently complete the comprehensive practical ability of the whole proce ...

Posted by jwright on Sat, 08 Jan 2022 10:44:53 +0100

[learning notes] tree dynamic programming

About tree DP Tree dynamic programming, as the name suggests, is to do dynamic programming on the data structure of the tree. Because the tree is naturally a recursive data structure, the implementation of tree DP is usually memory search. Because there are two types of transfer: push and pull, the transfer of natural tree DP also has two ord ...

Posted by tentaguasu on Fri, 07 Jan 2022 14:34:00 +0100

Version change of

Title Description You are given two integer arrays nums1 and nums2 in non decreasing order, and two integers m and n representing the number of elements in nums1 and nums2 respectively. Please merge nums2 into nums1 so that the merged array is also arranged in non decreasing order. Title Example Example 1: Input: nums1 = [1,2,3,0,0,0], ...

Posted by oneday on Fri, 07 Jan 2022 10:58:04 +0100