Search topics - daily practice
P1219 eight queens Checker Challenge
Eight queens Checker Challenge
Title Description For a checkers board of 6 * 6 as follows, six pieces are placed on the board so that there is and only one piece in each row and column, and there is at most one piece on each diagonal (including all parallel lines of the two main diagonals). T ...
Added by MasksMaster on Tue, 04 Jan 2022 19:16:29 +0200
Use memccpy function to replace unsafe and inefficient str[n]cpy, str[n]cat, etc
The memccpy function can replace the unsafe and inefficient str[n]cpy, str[n]cat, etc
The memccpy function is in the POSIX standard library and recently added to the C23 standard library. In the C runtime of MSVC, it starts with an underscore_ Memccpy exists. Functions that do not begin with an underscore are currently deprecated (these functi ...
Added by jokeruk on Tue, 04 Jan 2022 18:44:48 +0200
2022-01-02 swipe questions and punch in every day
2022-01-02 swipe questions and punch in every day
Flying book - daily question
42. Rainwater connection
Given n non negative integers to represent the height diagram of each column with width 1, calculate how much rain the columns arranged according to this can receive after rain.
Example 1:
Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Outp ...
Added by unsider on Tue, 04 Jan 2022 17:09:29 +0200
C language contains tree?! Function!
What is a function?
In computer science, subroutine (function, routine, method, subroutine, callable unit) is a part of code in a large program, which is composed of one or more statement blocks. It is responsible for completing a specific task and has relative independence compared with other codes.
catalogue
Library functio ...
Added by PolyPill on Tue, 04 Jan 2022 16:54:54 +0200
2021-07-26c++primer Chapter 10 exercises
10.1
#include<iostream>
#include<vector>
#include<algorithm>
#include<fstream>
using namespace std;
int main(int argc,const char*argv[]){
/*ifstream in(argv[1]);
if(!in){
cout << "Failed to open input file "< < endl;
exit(1);
}*/ //The meaning of this paragraph is completely ...
Added by dcav on Tue, 04 Jan 2022 15:48:27 +0200
C + + - cylindrical fitting FitCylinder
Scenario requirements
In image processing in various fields, there is often a demand for fitting surfaces. The most common is to fit inclined planes, and there are also scenes of fitting surfaces, spheres and cylinders. This paper introduces fitting cylinders.
Cylindrical fitting formula:
Based on this formula, we can get the coefficients ...
Added by eyespark on Tue, 04 Jan 2022 13:11:54 +0200
C++|C++ Primer Chapter 10 generic algorithm
Sequential containers define only a few operations: in most cases, we can add and delete elements, access the first and last elements, determine whether the container is empty, and obtain an iterator pointing to the position after the first or last element.
We can imagine that users may also want to do many other useful operations: find a spec ...
Added by XxDeadmanxX on Tue, 04 Jan 2022 12:13:55 +0200
Codeup1000000634 question B: P2 count words
Title Description:
Count the number of words (stat.cpp/c/pas) General text editors have the function of finding words. This function can quickly locate the position of specific words in the article, and some can count the times of specific words in the article.
Now, please program to realize this function. The specific requirements are: given ...
Added by Lars Berg on Tue, 04 Jan 2022 11:56:05 +0200
C + + improve notes
Static member
Type preceded by static
Static member variable
All objects share the same data Allocate memory at compile time and declare in class Out of class initialization
Static member function
All objects share the same function Static member functions can only access static member variables
Private permissions are also inac ...
Added by jordanwb on Tue, 04 Jan 2022 11:03:30 +0200
How to implement memory pool with 100 lines of C + + code
Memory pool is a kind of pooling technology. Through pooling, the number of resource object creation can be effectively reduced and the performance of program operation can be improved.
Complex memory problems, how to sort out their own ideas
1, Memory pool introduction
1.1 basic concepts
From the above figure, we can understand the genera ...
Added by misschristina95 on Tue, 04 Jan 2022 10:39:55 +0200