[charm of data structure] 001 Cognitive complexity & dichotomy & XOR operation
Constant time operation
If the execution time of an operation is not transferred by the specific sample size, each execution time is a fixed time. Such operations are called constant time operations.
Common arithmetic operations (+, -, *, /,%, etc.)Common bit operations (> >, > > >, < <, |, &, ^, etc.)Assignment, comp ...
Posted by Leadwing on Tue, 01 Mar 2022 13:25:55 +0100
SDNU_2020Shenyang_Qualification problem solution
C Gym - 102822D
analysis: The answer is monotonous and can be divided into two points. Then the focus is on the writing of the judgment function. Let's assume that the answer is X. because this question needs to reduce the bomb by - 1 before it explodes, it's very awkward. Let's first consider the case that the bomb explodes when it reaches 0. ...
Posted by jhuaraya on Fri, 18 Feb 2022 07:42:23 +0100
Atcoder beginer contest 205 (supplementary question)
D - Kth Excluded
Question meaning: give n numbers, ask q times, and ask the k-th largest number each time (after removing the N numbers on the number axis, the k-th largest number) Idea: for these n numbers, process out how many numbers in front of the current number have not been removed (how many numbers are on the number axis), and then wh ...
Posted by PyroX on Tue, 01 Feb 2022 03:31:22 +0100
7 questions to solve the binary search problem
The sequential array searches for a value
The basic idea of binary search is that the search interval must be orderly In this paper, all search is based on the closed interval. At this time, the condition in while should be written as l < = R If you search by the open interval (r=nums.size()), the condition in while should be written ...
Posted by erax on Sat, 29 Jan 2022 17:59:15 +0100
Introduction to java Foundation Day 6
Array simple basic algorithm
1. Creation of array and element assignment (if you know, there may be)
Yang Hui triangle (two-dimensional array), loop number (binary array), 6 numbers, randomly generated between 1-30 and not repeated
2. For numeric arrays
Maximum, minimum, sum, average, etc
/*Find the maximum, minimum, average, sum, etc. of ...
Posted by wdseelig on Sun, 23 Jan 2022 06:31:03 +0100
python algorithm template part I (quick sort, merge sort, integer bisection, real bisection)
Note: This article is after learning acwing Basic algorithm Course It is mainly used to record the template of python version algorithm.
1. Quick sort
Thought: Divide the list with a number (pivot) in the list. The number on the left is less than pivot and the number on the right is greater than pivot.
Steps: 1. Determine pivot. Left, right, ...
Posted by TheKiller on Sun, 23 Jan 2022 01:58:25 +0100
CF1550E - Stringforces - binary answer, shape pressure DP
E - Stringforces
Title Description
Give you a include? And before
k
k
k lowercase strings
s
s
s. You need to put each? Replace with previous
k
...
Posted by DataRater on Sun, 16 Jan 2022 19:44:58 +0100
leetcode question brushing diary-1044 Longest repeating substring
Title Description: Give you a string s and consider all its repeated substrings: that is, the continuous substrings of s appear 2 or more times in S. There may be overlap between these occurrences. Returns any repeating substring with the longest length. If s does not contain duplicate substrings, the answer is "".
...
Posted by vurentjie on Mon, 27 Dec 2021 08:00:47 +0100
SDUT 2021 Summer Individual Contest - 7 (supplementary question)
E - Charles in Charge
Topic meaning: a person riding on the road with a battery car can be charged at every point. You can run as many miles as there is electricity. Now you are required to run the distance. The smaller the battery capacity of the electric vehicle, the better. What is the minimum capacity of the electric vehicle. Idea: firs ...
Posted by arya6000 on Sat, 25 Dec 2021 05:22:29 +0100
CF484-E. Sign on Fence
Portal Given length is
N
N
Array of N Several triples
{
l
,
r
,
w
}
...
Posted by SergiuGothic on Thu, 23 Dec 2021 11:40:55 +0100