Luogu P4093 [HEOI2016/TJOI2016] sequence k-d tree

... 题描述 佳媛姐姐's birthday, her little friend bought a funny toy from a treasure to him. There is a sequence on the toy, and the values ​​of some items in the series may change, but at most one value changes at the same time. Now that Jiayuan’s sister has studied the possibility of all changes...


An example of a simulated real copy technique - reference count

... #include<iostream> Using namespace std; #include<string> Class myString { Public: myString() { Cout << "default constructor" << endl; _str = new char[5]; // describe the number of citations by 4 bytes of the header _str[4] = 0; getCount() = 1; } myString(const...


HDU T6015 Skip the Class

... 题解: 题意是Luras chooses to skip class, a class can only escape at most twice, and each class has its own value, seeking the value of the escaped course Maximum value. The most important thing about is how to record the number of times the course has been escaped. Because the course name is...


Algorithm to improve 3-3 to find the area of ​​the circular surface area volume

... problem description accept the value entered by the user, output the radius of the (1) circle area, (2) the surface area of ​​the sphere, (3) the sphere volume. The value of pi is 3.1415926536, and the result is 10 decimal places. Each column occupies 20 characters and is left-aligned. ...


Algorithm Improvement 5-3 Calendar

... 问题描述 known January 1, 2007 is Monday. The design-function prints the calendar for a certain month of the year after 2007 (inclusive) according to the following format, and refuses to print before 2007. To complete this function, it is also necessary to design the necessary helper...


Algorithm improvement Lin Dan war Li Zongwei

... 问题描述 We use 0 for Lin Dan and 1 for Li Zongwei. Each line in the input data will give a 0 or 1, indicating that the corresponding player gets 1 point. When a party scores 21 points, the party wins as long as the party has a difference of more than 1 point with the other party. You need...


The algorithm improves the factorial difference

... problem description given n and m and p, guarantees n>=m, and asks (n!-m!) for the result of p. Input format one line of three positive integers n, m, p. output format A non-negative integer representing the result. 样样输入 3 2 10 样样出 4 数据尺寸和约定 n,m<=20,p<=10000. #include<...


Algorithm Improvement String Skip

... 问题描述 Given a string, you need to output the character at the corresponding position of the string every step bit from the start bit. Input format The first line is a string containing only lowercase letters. The second line of two non-negative integers start and step, the meaning is...


Algorithm improvement The top 10

... 问题描述 has a lot of data, but we often only take the top few, for example, the Olympics only take the top 3. Now that we have n data, please output the top 10 data in order of largest to smallest. Enter the format two lines. The first line is an integer n, indicating how many data to be...


The algorithm improves the prime factor 2

... to decompose a prime integer N (1<N<32768) and output the prime factor in order of decreasing size. Finally, the number of prime factors is output. Input format one line, a positive integer output format two lines, the first behavior is separated by a space factor The number of...