1. Definition of heap sorting
N key word sequences KL, K2 ,..., Kn is called a heap, and only when the sequence meets the following properties (referred to as heap properties ):
(1) KI ≤ k2i and Ki ≤ k2i + 1 or (2) KI ≥ k2i and Ki ≥ k2i + 1 (1 ≤ I ≤
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2159
# Include
# Include
# Define max (A, B) A> B? A: B
Using namespace STD;
Int DP [105] [105];
Struct page {
Int W;
Int V;
} PG [105];
Int main (){
Int n, m, K, S, I, j, h;
While (~ Scanf ("% d", &
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2896
This question has been wa for many times, about 8 or 9 times. From CF to half, we started to adjust it here. After unremitting efforts, we finally found that the memset of TMD and VIS was
Http://poj.org/problem? Id = 3256
Store the paths of N farms in an adjacent table, record the initial number of cattle in each farm, and query the number and number of cattle in each farm along the path DFS.
Code:# Include
# Include
Using
Http://poj.org/problem? Id = 2251
Refreshing questions! But don't use all the RP as xcy said...
The BFS of 3D space only requires two more directions for searching.
Code:# Include
# Include
Bool vis [31] [31] [31];
Int lve [6] = {1, 0, 0, 0, 0,-1 }
Http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemcode = 2058.
A simple regular question.
The two adjacent characters in each line must be different.
When a row starts from 1, the '@' and '*' of an even number of rows must be half of each
Http://poj.org/problem? Id = 2485
The question is not difficult. The question is very difficult...
I have read it several times or I am confused!
Is to find the maximum edge weight in the Minimum Spanning Tree, take poj1287 and change it, decisive
# Include
# Include
# Include
Using namespace STD;
Const int nmax= 1000;
Class edge {
Public:
Int V, NEX;
}; Edge e [Nmax];
Int N, K, head [Nmax]; // head [I] is the head of the linked list starting from vertex I.
Void addedge (int A, int B) {//
Http://poj.org/problem? Id = 3009
In fact, at the beginning, we wanted to use dir as a parameter and search based on the map condition, but it was processed with while in recursion. It was hard to process the backtracking of map from 0 to 1.
The
Http://poj.org/problem? Id = 1226
Returns the maximum public substring of the given string and Its substring.
Suffix array, which connects all strings and Their substrings, separates them with delimiters, and marks the strings of each string and Its
Http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemcode = 1089.
Recursive arrangement and combination.
Code:# Include
Int data [20];
Int ans [6], N;
Void work (INT diex, int aiex ){
Int I;
If (aiex = 6 ){
For (I = 0; I Printf ("% d", ANS [I]);
Http://poj.org/problem? Id = 1159
The question of the card memory is even more disgusting!
If you use the int type to submit a message, you can only change it to short int, 65128 kb,Memory limit:65536k... indicates that it is speechless.
The
Http://poj.org/problem? Id = 2823
The input speed was used for purely monotonous queue exercises. The results showed that scanf was not as fast as scanf...
It was said that some time ago when we were doing monotonous optimization, we had some point
Http://poj.org/problem? Id = 3600
Enumerate the position of the first row of subimage in the image, and then select column C in the image. If the column C contains the same row of R and subimage, there is a solution.
Code:# Include
# Include
#
Http://poj.org/problem? Id = 1222
Similar to poj 1753, 1753 is the number of steps for full 0 or full 1. This is a solution for full 0.
At that time, I changed the code by 1753. The number of enumeration steps is up to 30 steps. In this case, the
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2199
The simple binary search should belong to the water question... the Tangle is that the example has not passed, and the AC is a try.
These two days are too bad, so I feel overwhelmed when so many
Http://poj.org/problem? Id = 2752
The next Array application of KMP. In a word, next [J] must be the maximum value that satisfies STR [1 .. next [J] = STR [J-next [J] + 1. J.
Take abababa as an example. If next [7] = 5, STR [1 .. 5] = STR [3 .. 7],
Poj2406http: // poj.org/problem? Id = 2406
Given a string, the maximum number of identical substrings cannot be overlapped.
The next Array application of KMP. How can we determine whether such a substring exists and the number of substrings.
The
Http://acm.timus.ru/problem.aspx? Space = 1 & num = 1180
Simple reasoning game. Observe the number to be retrieved at a time, such as 1, 2, 4, 8, 16 ..., the remainder of 3 is 1, 2, 2, 1 ..., that is to say, it is impossible to use only one
Http://poj.org/problem? Id = 1564
Http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemcode = 1711.
Simple Deep Search, mainly this sentence if (! Vis [I] & Data [I]
Ensure that two consecutive identical numbers only have one chance to enter
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service