Description:
Give you n reservoirs, telling you the XY coordinates (meters) of each reservoir and the cost of this reservoir.
If the two reservoirs need to be connected, the cost of the connection is the absolute value of the height difference
Evaluate the longest common subsequence for the basic template question.
Here, we use a rolling array to save the intermediate value, because we only need to save the values of the adjacent two rows.
To determine the length of 1936 PKU, you only
DijkstraAlgorithmTemplate question, Xi, the first most short-circuit, template question, originally fantasized about 1A, but unfortunately, one condition is missing, a very important condition, since it is the shortest short circuit, if there is a
Question: seek the longest reply string
Manacher can be used to solve the problem in O (n) time.
# Include # include # include # define maxn 200010 using namespace STD; char str1 [maxn], STR [maxn * 2]; int rad [maxn * 2], NN, N; void manacher
Question: + or-in the middle of N integers, can the calculation result be divisible by K. 1
Idea: although it is not an optimization problem, it is indeed a DP. At the beginning, I did not remember how to implement DP. We can regard the result
Tian Ji's horse racing is a classic greedy, but it's hard to think of it. Every time you use the fastest and fastest, the slowest and the slowest to compare and judge
1) if Tian shortest is slower than Wang shortest, he will lose the game using
This question is very familiar with the food chain, and there are also three types, so the formula is the same.
The question is to find out the only judge in it. Judge is especially because he does not have a fixed category, so he can only
Well, it's not hard to solve this problem, that is, adding two marks to the node.
Because you want to add and determine whether a string is the prefix of a string, you need to add these two tags.
V indicates whether a string ends at the node.
Xiao Ming's time constraints that are good at arrangement:
1000 MS | memory limit:
65535 KB difficulty:
4
Description
James is very clever and very good at arranging computing. For example, if you want to give a small
Yuan honggang'sProgramEmployee cultivation path
Without knowing it, I have been doing software for ten years. I have the joy of success and the pain of failure, but I dare not say that I am a master because I am in comparison with my real masters,
If men cocould learn from history, what lessons it might teach us! ButPassion and party blind our eyes, and the light which experienceGives is a lantern on the stem, which shines only on the wavesBehind us!Samuel Taylor Coleridge, recollections
Specialized four-digit numbers
Time limit:2 seconds
Memory limit:65536 KB
Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits
Well, I really want to see that the trie tree is used for classification, but I have no idea about it, and I am using brute force.
If the same word cannot be found, there are only three similar cases.
CodeGood understanding
# Include using
Kill the monster
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 502 accepted submission (s): 345 Problem descriptionthere
Is a mountain near yifenfei's hometown. On the mountain lived a
Game of classic tree games
If a tree is given as a question, although a tree is specified as a root, the data is given as a branch, so it is undirected.
View code
# Include # Include # Include String > # Include Using Namespace STD;
In an apple tree, there are n nodes. On the first day, only leaf nodes have apples. The number of apples equals the number of nodes. Starting from the next day, other nodes start to grow the apple. For non-leaf nodes, they only start to grow after
Basic Line Segment tree interval modification and interval summation
PostCodeRight
# Include # define n 100010 struct node {int L, R; _ int64 C, sum; // use C to store value-added values on this node, sum is used to store the sum in the
Slightly modified the hdu1874CodeIt goes through
However, 31 MS is a major defect
Fspa version:
# Include # include # include # define maxn 110 using namespace STD; int map [maxn] [maxn]; // map [I, j] is the distance from the initial input
Zjnu Stadium
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 626 accepted submission (s): 261 Problem descriptionin
12th Zhejiang College Students games 2007, there was a new stadium
Built in
Triangle love
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/65536 K (Java/Others)Total submission (s): 1387 accepted submission (s): 584 Problem descriptionrecently,
Scientists find that there is love between any of two people.
Example,
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