Summary of problem solutions for single week competition on January 30, 2022

T1 5993. Multiply the found value by 2  Give you an integer array nums, and give you an integer original, which is the first number to search in nums. Next, you need to follow the following steps: If the original is found in nums, multiply the original by 2 to get a new original (that is, make original = 2 * original). Otherwise, stop the ...

Added by Hagaroo on Sun, 30 Jan 2022 14:22:02 +0200

Differences in the use of HashSet, TreeSet and LinkedHashSet

We often deal with sets in daily life, but how to choose the corresponding data structure is often unclear. Today, let's take a brief look at the differences between HashSet, TreeSet and LinkedHashSet We all know that Set sets do not contain duplicate elements, which is an important reason why we choose to use Set sets Set set has three com ...

Added by dzekic on Sun, 30 Jan 2022 14:11:30 +0200

PTA class a simulated third bomb: 1140-1143

I feel like I'm redeeming the sin of not practicing the algorithm well in College for three years 😓 1. Summary of knowledge points The knowledge points involved in this operation include: string manipulationSTL + sortgraph theoryBST tree (time complexity) Title numberdifficultyKnowledge points1140🐸String and number conversion + English Re ...

Added by brotherhewd on Sun, 30 Jan 2022 13:17:04 +0200

BFS solving maze problem

Breadth first search definition Breadth first search, also known as breadth first search, is accessed layer by layer, which is similar to the hierarchical traversal of the tree. The vertices of the graph are many to many, and are accessed from near to far relative to the starting point until all nodes are accessed. BFS traversal process ...

Added by y.t. on Sun, 30 Jan 2022 09:47:25 +0200

Idea analysis and code analysis of PTA Hashing

1, Forerunner 1. Knowledge to be mastered Implementation of Hash / Hash table through open address method 2. Topic information 2.1 topic source: PTA / puzzle A 2.2 Title address: 7-17 Hashing 2, Analysis of problem solving ideas 1. Understanding of the topic Insert the entered number into the Hash table and print the inserted posit ...

Added by flashroiem on Sun, 30 Jan 2022 08:42:07 +0200

String of data structure and algorithm

String of data structure and algorithm The common operations are string and number. String is still very important. Basic knowledge 1. Input and output List some commonly used things that cin itself needs to learn a lot... cin: use whitespace (spaces, tabs, and newlines) to determine where the character ends, which means that cin reads only ...

Added by pearllysun on Sun, 30 Jan 2022 08:39:12 +0200

Professor, take you to learn the linked list: getting to know the linked list 1

Title Description: Input three integers from the keyboard to represent the scores of three students. Assuming that the score is between 0-100, output the scores of these three students. The data are separated by spaces, and there are spaces after the last data. sample input 70 80 90 sample output 70 80 90 #include<iostream> #inclu ...

Added by spighita on Sun, 30 Jan 2022 08:10:35 +0200

Struct, struct variable, struct pointer, string

structural morphology Array is used to save a group of data of the same type, while structure is used to save a group of arrays of different types Before using a structure, you must first define the structure type, because C language doesn't know what types of data you need to store in your structure. We must tell C language what types of data ...

Added by Code_guy on Sun, 30 Jan 2022 06:28:09 +0200

2022 Niuke winter vacation algorithm basic training camp 3

I went to visit relatives that day. Later, I vp got away with it. I can only say that I escaped from the real hell (Wuwuwuwu was killed by brother zhinai). 6 in the game and 8 after the game, it was estimated that rank was about 450, so I gave an estimated score A: Successful, 0 B: Backpack, 6 (1) C: dp (supplementary) D: Check in, 2 E: An ...

Added by evil turnip on Sun, 30 Jan 2022 02:13:31 +0200

std::vector>Tp>push_ Implementation principle of back(const Tp&val)

background The std::vector<Tp>container of C++ Standard Library has continuous memory, which has great advantages in some applications, such as the operation compatible with C language. We store n POD type data in vectors, such as std::vector<double>vec(20). I want to empty the data to 0. I can use memset(vec.data(), 0, vec.siz ...

Added by porrascarlos80 on Sun, 30 Jan 2022 01:54:34 +0200