Labeling balls:http://poj.org/problem?id=3687
Main effect: N a small ball of 1-n, given the weight relationship between small balls. In accordance with the premise of weight relationship, the first output number of small ball.
Idea: is also a very
All-ranked issues are common in the company's written tests, where recursive and non recursive implementations are introduced.
Recursive algorithm
1, Algorithm summary
Simply put: The first number is exchanged for the following number E.g:e = (A,
HDU 1411:http://acm.hdu.edu.cn/showproblem.php?pid=1411
The person is one of you a hexahedral six sides, seek hexahedral volume.
Train of thought: there is no idea, is to use Euler tetrahedron formula directly into.
Euler Tetrahedron formula:
HDU 1286 Find a new friend: http://acm.hdu.edu.cn/showproblem.php?pid=1286
Question: Chinese problem.
Idea: The pure template problem of Euler function, there is nothing to say, it is mainly to understand the meaning of Euler function.
In number
HDU 3501 Calculation 2:http://acm.hdu.edu.cn/showproblem.php?pid=3501
To find the sum of the numbers between 1~n and N coprime.
Idea: The application of Euler function; First, the Euler function is used to find the total m of n coprime, the sum of
A few concepts:
Optimization problem: There are n inputs, whose solution consists of a subset of these n inputs, which must satisfy certain predetermined conditions, which are called constraint conditions, which satisfies the solution of the
Content: Known two elements from small to large array x[] and y[], write a program that calculates the smallest of the absolute values of the difference between two array elements.
Number, this value is called the distance of the array.
For
Content: An array that has been sorted from small to large, one of the platforms in this array is a continuous string of identical elements, and this element cannot be extended.
For example, 1,2,2,3,3,3,4,5,5,6 is a platform in 1,2,2,3,3,3,4,5,5,6.
Dynamic programming
Basically is said: You chase a Meimei, need to the girls around the close friends all good, so you chase Meimei this problem decomposition for its Meimei friend problem, only to solve these problems, finally you can catch Meimei.
For non-direction graphs
Algorithm 1
We know that for the loop 1-2-3-4-1, the degree of each node is 2, based on this we have the following algorithm (this is similar to the topological ordering of the graph):
To find out the degree of all
[Question:]
Given A string s consists of Upper/lower-case alphabets and empty space characters ' ", return the length of last word in The string.
If The last word does isn't exist, return 0.
Give you a string, try to get the length of the last
The previous article introduced a combined ordering of O (NLGN) with time complexity, which describes the same time complexity as O (NLGN) but fast sorting faster than the merge sort (quick sort).
The rapid sequencing is one of the top ten
Merge sorting, as the name suggests, is done by merging two ordered sequences into a large ordered sequence. Merge ordering is a typical divide-and-conquer algorithm: First, the sequence is divided into two parts, then each part is recursively
Recently at home in the evening to see algorithems,4th Edition, I bought the English version, I think this book is relatively straightforward to understand, and "map code and Mao", taking advantage of this opportunity to learn to do a good job of
1. Introduction:
To remove the edge of the Left (V0,V2), you need to delete two nodes from the shadow of the table below.
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/
2. Storage structure adjacent to
1. Introduction:
For a forward graph, the adjacency table is flawed:
adjacency table: Care about the problem, want to understand the degree must traverse the entire map to know.
Inverse adjacency table: Solve the degree of penetration, but do not
Converts the normally normal formula with parentheses to the inverse Polish style.
Input and output are the following examples:
Input:3(A + (B*C))((a+b) * (z+x))((a+t) * ((b + (a+c)) ^ (c+d)))
Output:abc*+ab+zx+*at+bac++cd+^*
Summing up the law
Give a number, well, it's not a number, it's a bunch of numbers,
Like 98237482340328490328490324893024, a very long number.
To find the next palindrome, this palindrome is larger than the current value (not equal to).
Such as:
9 9 9 9->1 0 0 0 1
Interesting topic: On a square from the top left corner to the right, each time to walk one, hit the side right, or hit the checked grid to the right, ask the last traverse all the grid when you are facing that direction?
For Example:consider the
Topic:
A tram, already aware of the number of people who get off at each stop, ask the tram how much capacity is needed to give all passengers a lift?
Sample Test (s)Input
40 32 54 24 0
Output
6
Every station is first, then it is a very simple
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