Python solution of group C++B of the 9th 2018 Blue Bridge Cup
A what day
January 1, 2000 is the first day of that year. So, May 4, 2000, is the first day of that year? Note: what needs to be submitted is an integer. Do not fill in any redundant content.
Answer: 125
31+29+31+30+4=125
B clear code
The font of Chinese characters exists in the font library. Even today, the 16 dot matrix font library is s ...
Posted by rbragg on Fri, 25 Feb 2022 14:46:35 +0100
10 commonly used algorithms (8 ~ 10)
10 commonly used algorithms (8 ~ 10)
1, Dijkstra algorithm
Application scenario - shortest path problem
[the external chain image transfer fails. The source station may have an anti-theft chain mechanism. It is recommended to save the image and upload it directly (img-g8rjj2vk-1645791772844) (C: \ users \ Luo'xin \ appdata \ roaming \ typora ...
Posted by skorp on Fri, 25 Feb 2022 13:29:37 +0100
20220225_ Datawhale 34_ leetcode_7 double pointer
Seven double pointers
1.1 Foundation
Collision pointer: refers to two pointers, left and right, pointing to the first element and the last element of the sequence respectively, and then the left pointer increases and the right decreases until the values of the two pointers Collide (i.e. left == right), or meet other special conditions.
...
Posted by ldougherty on Fri, 25 Feb 2022 09:24:46 +0100
[template] zhinai sauce's static array maintenance problem polynomial (multiple difference array - polynomial processing)
subject
Original question link
Problem description
thinking
The advantage of differential array is that it can move the whole body by pulling one hair. By processing one position, the values of subsequent positions can be changed.
The operation we are facing at this time is to process the interval, and the processing is not simply ad ...
Posted by Ruiser on Fri, 25 Feb 2022 09:12:05 +0100
Algorithm problem push domino simulation, queue and black magic
Push domino simulation, queue and dark magic
subject
Arrange n dominoes in a row and erect each dominoes vertically. At the beginning, push some dominoes to the left or right at the same time.
Every second, the dominoes that fall to the left push the adjacent dominoes to the left. Similarly, a domino upside down to the right will push th ...
Posted by DavidT on Fri, 25 Feb 2022 05:43:40 +0100
[data structure and algorithm] unidirectional ring linked list and Josephu ring
Josephu
Joseph Ring – the leading out of one-way ring linked list
Josephu's problem is: let n people with numbers 1, 2,... N sit around. It is agreed that the person with number k (1 < = k < = n) will count from 1, and the person who counts to m will be listed. Its next person will count from 1, and the person who counts to m will ...
Posted by mvd7793 on Thu, 24 Feb 2022 19:00:53 +0100
Reading HashMap source code from scratch
preface
I believe that this article is not the first time for my classmates to see articles about HashMap. Most of the online HashMap articles are not suitable for me, so I decided to understand the source code from scratch. I will use the relatively simple logic to convince myself to understand the source code. If you are interested, please l ...
Posted by racing_fire on Thu, 24 Feb 2022 16:55:12 +0100
[sword finger Offer 54. The k-th node of binary search tree]
Title Description:
Source: LeetCode Link: https://leetcode-cn.com/problems/er-cha-sou-suo-shu-de-di-kda-jie-dian-lcof
Given a binary search tree, please find the value of the k-largest node.
Example:
Example 1:
input: root = [3,1,4,null,2], k = 1
3
/ \
1 4
\
2
output: 4
Example 2:
input: root = [5,3,6,2,4,null, ...
Posted by straycat on Thu, 24 Feb 2022 16:41:52 +0100
[learning record of the third week of February] data structure and algorithm Wang Zhuo - Chapter 2 linear table - single linked table (function definition)
catalogue
1. Storage structure and definition of single linked list
storage structure
Function definition
Example: Student transcript
2. Function definition
2.1 initialization function
2.2 empty judgment function
2.3 destruction function
2.4 emptying function
2.5 finding table length function
2.6 search function by location
2.7} fi ...
Posted by dvwhi on Thu, 24 Feb 2022 14:31:42 +0100
Implementation of Python data structure
preface
Data structure is the way that computer stores and organizes data. A data structure is a collection of data elements that have one or more specific relationships with each other. In general, carefully selected data structures can bring higher operation or storage efficiency. Data structure is often related to efficient retrieval al ...
Posted by richo89 on Thu, 24 Feb 2022 12:04:23 +0100