[Topological sorting]

Topological sorting is a sort of Directed Acyclic graphs. Indicates the order in which vertices appear in the edges. If a ring exists, the order of two vertices cannot be indicated. In real life, there will also be many application examples, such as

[Expression evaluation] HDU 4192

Compare the value of water to calculate the expression value. enumerate each variable and you can find a place where I is missing when the expression is evaluated. Contribution 1wa # Define n 10005 char STR [N]; int num [N]; char op [N]; int V [1

[Trie tree] HDU 2846

For the first time I came into contact with the dictionary tree, I referred to other people's code. Here I would like to thank everyone! This question is given n words, with M inquiries. Note that these questions can be subsequences of words, so how

[DP] HDU 2845

Perform DP for each row from left to right, and then perform DP twice from top to bottom! #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using

[Job Scheduling-Greedy] poj 2751

Http://poj.org/problem? Id = 2751 For the greedy policy, refer to the CMP function. Simply put, the S1 job and you can quickly complete it so that it can be transferred to S2 as soon as possible. Note that S1 has no idle time, and S2 may have idle

[Weak connectivity component] poj 2762

Http://poj.org/problem? Id = 2762 N points and M entries for the questionUnidirectional edgeTo check whether any two points x and y exist, so that X-> Y or Y-> X can be used to calculate the weak connected component .... Method: Point Reduction +

[Tarjan dual-Connected Component + Color Determination bipartite graph] poj 2942

This debug question is so depressing !!! First there is a problem with dyeing, and then there are various small errors .... We can use the bipartite graph standard to determine the odd circle, because the odd circle is definitely not a bipartite

[Expectation of DP] poj 3756

DP expectation Double DP [1024] [111]; // DP [I] [J] probability of round to J: bool stop [111]; int go [111]; int N; int main () {While (scanf ("% d", & N )! =-1) {int I, j; int m; memset (go, 0, sizeof (GO); memset (STOP, 0, sizeof (STOP ));

[O (nlgn) determination point in the convex hull] codeforces round #113 (Div. 2) B

For more information, see bloghttp: // hi.baidu.com/aekdycoin/blog/item/7abf85026f0d7e85d43f7cfe.html. Complexity is O (nlgn) # Define n 100005 struct node {Double X, Y;} A [100005]; double cross (node A, Node B, node c) {//> 0, AB in AC clockwise;

[Rmq] poj 2452

# Define n 50010int A [n]; int max (int I, Int J) {return a [I]> A [J]? I: J;} int min (int I, Int J) {return a [I]> A [J]? J: I;} int dp1 [20] [N]; // DP [I] [J] indicates that the length starts from J and ranges from 2 ^ I to the maximum value

[Stable_sort stable sorting]

Today, we found out that there was such a magic DD-stable_sort after refreshing Ural 1100. The function is to use multiple values, sort by the third parameter without changing the appearance order of other values... Er, it's hard to understand.

OS Page Replacement Simulation System

# Include # include # include # include # include # include # include # include # include # include # include # include # include # include # include using namespace STD; int Address [322]; // command address int num [322]; // access

[2-sat + binary] poj 2749

Http://hi.baidu.com/%8E%E1%D0%B3/blog/item/3f5354fa18498c01d9f9fd4a.html # Define n 1111 vector V [N]; stack S; bool vis [N]; bool instack [N]; int low [N], dfn [N]; int belong [N]; // The Strongly Connected Component int n, m, step, t, a, B; int

[Partition tree] HDU 3473

The question is to find the absolute value of the difference between the median and other elements and then sum the value of [L, R ]. Method: Use the tree to find the median, and query the left and left elements of the median, therefore, we need to

Poj2942 point dual connected odd circle-bipartite graph judgment knights of the Round Table

Some knights hate each other in the round table of King Arthur, so that they cannot sit together during the meeting. That is, some people are not allowed to attend the meeting. If a knight fails to attend all meetings, he will be evicted. It is now

[Game Theory]

Recommended:Wutianqi's blog Find a balance (also known as a "fail" or a singular situation). (Yes: any non-equilibrium state can be changed to an equilibrium state after one operation) (1) bash game ): There are only one pile of N items, and two

Tarjan calculates the cut point hoj1007spf

// Cut point hoj1007 # include # define min (A, B) A> B? B: A; # define max (A, B) A> B? A: B; const int v = 1001; struct edge {int next, to;} edge [V * V]; int CNT, idx; int cut [v], n, head [v]; int low [v], dfn [v]; void Init () {CNT = 0; idx = 0

[Joseph TEMPLATE]

The specific can be selected Monkey King as an example of http://poj.grids.cn/practice/2746 Mark this template here. # Include using namespace STD; int last [400] [400]; void count_monkey (int n, int m) {If (n

[2-Sat]

For more information, seeThis 2-Sat question by symmetry algorithm is a collection of 2-SAT questions by symmetry. Check againAnalysis of Zhao Shuang's 2-Sat Solution After reading this, we can basically understand what 2-Sat is like. To put it

[Partition tree]

Both the tree division and the merged tree use the line segment tree as an aid. The principle is based onFast sortingAndMerge Sorting. The building process of the tree division is to simulate the fast sorting process, take the value of an interval

Total Pages: 64722 1 .... 56256 56257 56258 56259 56260 .... 64722 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.