PTA enumeration and simulation type eight questions
catalogue
1. Enumeration - Full Permutation
2. Simulation - (3n+1) conjecture
3. Enumeration - clumsy fingers
4. Enumeration - find the number of prime numbers
5. Enumeration - longest non repeating subsequence
6. Simulation - code run time
7. Simulation - Happy boxing
8. Simulation happiness derivation
1. Enumeration - Full Permutati ...
Added by senthilnayagam on Tue, 25 Jan 2022 18:48:16 +0200
The maximum value of the queue and the maximum value of the sliding window
Title Description
Given an array num and the size k of the sliding window, please find the maximum value in all sliding windows.
Example:
Input: nums = [1,3,-1,-3,5,3,6,7], and k = 3 Output: [3,3,5,5,6,7] Explanation:
Position {maximum value of sliding window --------------- ----- [1 3 -1] -3 5 3 6 7 3 1 [3 -1 - ...
Added by numan82 on Tue, 25 Jan 2022 18:45:53 +0200
Chapter 12 class and dynamic memory distribution
12.1 dynamic memory and classes
#ifndef D1_STRINGBAD_H
#define D1_STRINGBAD_H
#include <iostream>
class stringbad {
private:
char * str;
int len;
static int num_strings; //Static member variable. Only one static copy is created
public:
stringbad(const char *s );
stringbad();
~stringbad();
friend std::ostrea ...
Added by 0p3n_p0rT on Tue, 25 Jan 2022 12:51:06 +0200
Blue Bridge Cup training match
catalogue
7-1 contraction summation
7-2 isosceles triangle
7-3 settlement issues
7-4 flight time
7-5 global warming
7-6 weights of complete binary tree
7-7 children's worship circle
*7-8 multiple problem
7-9 incrementing triples
*7-10 spiral polyline
*7-11 log statistics
*Maximum product of 7-12
*7-13 fall resistance index
*7-14 t ...
Added by 2kau on Tue, 25 Jan 2022 09:54:55 +0200
C++STL standard library learning note function object
catalogue
preface:
Text:
1. Function object
2. Function object class template in STL
3. Application of greater
4. Use custom large and small relationships in STL
5. Example: write MyMax template
Postscript:
preface:
In this note, I annotated most of the code. Some of my ideas and comments were marked in blue, and the key points and ...
Added by Revan on Tue, 25 Jan 2022 06:45:53 +0200
Model Summary - dynamic programming
Yan's dp analysis
Learn the algorithm on AcWing, y is always strong! ha-ha When using this method to solve the dp problem, the introduction is clear, that is, thinking about the dp problem from the perspective of set. The following is an example of the 01 knapsack problem
When thinking about a DP problem, we can think about the problem f ...
Added by 3.grosz on Tue, 25 Jan 2022 05:42:12 +0200
C + + - STL(string container)
catalogue
string container
Basic concept of string container
string constructor
Assign a value to a string
String string splicing
string find and replace
String string comparison
String string access
string insert and delete
String string
string container
Basic concept of string container
String is a C + + style string, and string ...
Added by Imperialdata on Tue, 25 Jan 2022 03:14:19 +0200
c + + standard library Chapter 5 general tools 5.2 smart pointers
1, Starting with c++11, the standard library provides two types of smart pointers
1,shared_ptr implements shared ownership. Multiple smart pointers can point to the same object. The object and its related resources will be released when the "last reference is destroyed". The standard library provides break_ ptr, bad_ weak_ PTR and en ...
Added by jimbob on Mon, 24 Jan 2022 23:42:44 +0200
cpp ► STL container - > sort container - > map
describe
std::map
template <class Key, class T, class Compare = less<Key>,
class Alloc = allocator<pair<const Key, T>>>
class map;
map is an association container used to store elements composed of key value pairs in a specific order.
In a map, the key value is usually used to sort and uniquely identif ...
Added by justinede on Mon, 24 Jan 2022 18:56:13 +0200
C + + binary search tree
Binary search tree
The concept of binary search tree
Binary search tree is also called binary sort tree (because the data is ordered in the middle order). It is either an empty tree or a binary tree with the following properties.
If its left subtree is not empty, the values of all nodes on the left subtree are less than those of the root ...
Added by swedee on Mon, 24 Jan 2022 16:35:34 +0200