For example, if you know a sequence, you need to do the following two operations:
1. Add a number to x
2. Find the sum of each number in a certain interval
I / O format
The first row contains two integers, N and M, which respectively represent the number of numbers and the total number of operations in t ...
Posted on Sun, 31 May 2020 10:01:32 -0700 by MNSarahG
Only two numbers in an array appear once, and all other numbers appear twice. Write a function to find the two numbers that only appear once. LeetCode: Once only numbers, title links
Output: 4, 5
Method 1: sort the array first, and then compare the adjacent numbers to see if they are the same. Figure:
Posted on Sat, 09 May 2020 08:15:09 -0700 by sholtzrevtek
Recently completed the course design of data structure, and was assigned the title of Huffman coding and decoding. Now share your achievements in this blog.
When I was designing, I referred to the algorithm and code of many teachers and predecessors on the Internet, and thanked them! Their achievements have given me a lot of inspiration and hel ...
Posted on Mon, 04 May 2020 21:59:45 -0700 by welsh_sponger
A - Buggy Sorting
Title: This title is to give you an incorrect sorting method, which requires you to determine if there is a correct running result.If the correct result exists, then output-1, otherwise output an example illustration is wrong.The input to the title is the number n of elements.
Question: This is an interesting question and it i ...
Posted on Thu, 23 Apr 2020 09:34:04 -0700 by nepeaNMedia
1, Source code description
Freecplus is a C/C + + open source framework under Linux system. Please go to the C language technology network (www.freecplus.net) to download the source code.
This paper introduces the use of connection and sqlstatement classes to operate MySQL database in freecplus framework.
The declaration file of the class is f ...
Posted on Mon, 20 Apr 2020 09:34:46 -0700 by dkoolgeek
Background of topic
This is a template problem.
Read in a string composed of upper and lower case letters or numbers with a length of nn. Please sort all non empty suffixes of this string in dictionary order from small to large, and then output the position of the first character of the suffix in the original string in sequ ...
Posted on Sun, 19 Apr 2020 09:00:22 -0700 by plautzer
A. Electric Bill
Topic: This is a simple question, equivalent to the group function of an elementary school Calculating Electricity costs.
Question: Check in the question.
#define ll long long
using namespace std;
Posted on Thu, 09 Apr 2020 18:45:35 -0700 by Liam-PHP
Algorithm (function template)
less and greater function objects
Prototype: typedef basic_string < char > string;
string s1("Hello world!"),s2="Test",s3(8,'x')，s4; //String representing ...
Posted on Sun, 05 Apr 2020 10:13:12 -0700 by Axem
Class template and derivation
Class templates and friends
static member in class template
Function: improve program reusability and generate corresponding functions automatically when the program is compiled
Class and typename in the type parameter table of function template and class template can be ...
Posted on Sun, 05 Apr 2020 03:25:36 -0700 by AffApprentice
I / O stream
File read write [^ 1]
I / O stream
I / O class derivation
Standard flow object
Standard input stream: cin -- connected to standard input device, istream object
Standard output stream: cout -- connected to standard output device, ostream objectcerr -- connected to standard error output device (no buf ...
Posted on Sat, 04 Apr 2020 01:54:31 -0700 by fallen00sniper