Shenyang University of Chemical Technology & Qufu Normal University Joint Monthly Competition in January

A . A. A. Come and help Xiaoxin The meaning of the question is very simple, input two strings, find the second string in the first string, output yes if successful, otherwise output no But Xiaoxin is sick, he can't distinguish the thr ...

Posted by riddlejk on Sun, 29 Jan 2023 08:52:45 +0300

Eulerian sieve, Euler sieve (number theory)

Echelon sieve / Euler sieve for prime numbers At the beginning of the beginning, I recommend two videos, uh, my introductory video (let others go elsewhere for the crumbs (bushi) before I start talking) Little broken station (well, this teacher is very vivid) Small broken station (actually I am a fan of this teacher...) Now if you give us a ...

Posted by Eddie Fisher on Wed, 25 Jan 2023 19:41:19 +0300

[Winter vacation practice] day1

foreword If you accumulate steps every day, you can reach a thousand miles. The level is limited, please correct me if there are any deficiencies. multiple choice 1. What is the output of the following code ( ) char a=101; int sum=200; a+=27; sum+=a; printf("%d\n",sum); A:327 B:99 C:328 D:72 analyze The representation range of ...

Posted by LordPsyan on Wed, 25 Jan 2023 10:12:33 +0300

[Detailed C++] In-depth understanding of classes and objects (six default member functions)

Reminder This article has a total of 6736 words, and it takes about 20 minutes to read it. written in front This article is the second in the explanation of C++ classes and objects. By the time of this article, we have really started to get to the really difficult place for classes and objects. This article focuses on the explanation of the ...

Posted by Xster on Sun, 22 Jan 2023 06:58:01 +0300

Codeforces Round #843 (Div. 2) A ~ C Solution

A1&A2 Gardener and the Capybaras Title meaning Simple version: A1 Hard version: A2 A string contains only two letters a and b. Please divide this string into three non-empty strings so that the lexicographical order of the second string is the largest or the smallest. The data range of the hard version requires that the problem be solved ...

Posted by cbullock on Thu, 12 Jan 2023 20:11:38 +0300

The underlying principle and simulation implementation of stack and queue of c++ stl

1. The use of stack Second, the simulation implementation of stack #define _CRT_SECURE_NO_WARNINGS 1 #pragma once #include<vector> #include<list> //adapter pattern namespace sk { template <class T, class Container = deque<T>> class stack { public: bool empty()const { return _con.empty(); } size_t ...

Posted by scialom on Wed, 11 Jan 2023 05:02:44 +0300

C++ Primer Plus Exercises and Answers - Chapter 16

Exercises are selected from: C++ Primer Plus (Sixth Edition) The content is for reference only, please correct me if there is any mistake! Smart pointer template class review questions 1. Consider the following class declaration: class RQ1 { private: char * st; // points to C-style string public: RQ1() { st = new char [1]; ...

Posted by mike0193 on Tue, 10 Jan 2023 08:07:29 +0300

C++ classes and dynamic memory allocation

1. Dynamic memory and classes Static data members are declared in the class declaration and initialized in the file containing the class methods. The scope operator is used during initialization to indicate the class to which the static member belongs. If the static member is an integral or enumeration type const, it can be initialized in the ...

Posted by rocket on Sun, 01 Jan 2023 23:52:07 +0300

Reference counting of smart pointer shared_ptr

    Previous Article  🔗 smart pointer unique_ptr Introduced unique_ptr, and the main difference between shared_ptr and unique_ptr is that multiple shared_ptr can manage the same object, which is realized through copy constructor and reference counting mechanism. shared_ptr(const std::__1::shared_ptr<_Tp> &); shar ...

Posted by creatives on Fri, 23 Dec 2022 21:12:22 +0300

c++ common data types

type of data The meaning of data type existence: allocate appropriate memory space to variables There are several ways to represent integer types in C++, the difference is that the memory space occupied is different: short (short integer) Occupied space: 2 bytes int (integer) Occupied space: 4 bytes long (long integer) Occupied space: 4 by ...

Posted by simn_stv on Tue, 20 Dec 2022 00:17:37 +0300