Poj 1502 MPI maelstrom

Dijkstra ssip # Include Stdio. h > # Include String . H > # Include Stdlib. h > Using Namespace STD; Const Int Maxn = 101 ; Const Int Maxint = 32767 ; Int G [maxn] [maxn]; Bool Used [maxn]; Int

Poj 1789 truck history

Where the sum goes over all pairs of types in the derivation plan such that to is the original type and TD the type derived from it and D (to, TD) is the distance of the Types 1/Σ (to, TD) D (to, TD) The derivative relationship has a directed

PKU 3159 candies

# Include Iostream > # Include Vector > # Include Queue > # Define Maxn 30001 Using   Namespace STD; Struct Type1{ Int V, W; Bool   Operator   ( Const Type1 & E) Const { Return W > E. W;}}

HDU 1512 Monkey King

And query set obviously needs to be used Left-side tree solution for merging This question shows the strength of the data structure! # Include Stdio. h > # Include Algorithm > Using Namespace STD; Const Int Maxn =

PKU 2853 sequence sum possibilities

Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /* Derivation Using the Equi-ary series formula */ # IncludeIostream># IncludeCmath>Using NamespaceSTD; Int Main (){ Int CAS, CNT, number;

Splay tree-stretch tree

From http://www.fcicq.net/   Assume that you want to perform a series of search operations on a binary search tree. In order to make the entire search time shorter, those entries with high query frequency should always be near the root of the

Extend the tree

Although ysy mentioned in the national team paperCodeThe complexity is low, but I personally think it is too long for ACM competitions. It is much better to write a treap, especially when only a slow binary tree is needed. A great cow told me that

PKU 1185 Artillery Position

"N This shape is basically the mark of State compression dp (a few hundred or so, a dozen or so ). One layer goes down to DP, and each layer is only affected by the first two layers. After calculation, each layer has a maximum of 60 States, and

HDU 1863 smooth Engineering

Whether the read edge weight is smaller than the original Edge Weight # Include Iostream > # Include Fstream > # Include String . H > Using Namespace STD; Const Int Maxn = 1000 ; Int G [maxn] [maxn]; Int

PKU 3352 Road Construction

A connected graph is provided. If you cut any edge and make the Graph Connected, add at least a few sides. As a result, the key edge is connected to a tree, and it is easy to prove that the edge at the leaf is the best. I read several articles

PKU 1654 Area

Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /* Calculate the area of a polygon using cross Multiplication */ # include iostream > # include cmath > # define maxn 1000001

HDU 1232 smooth Engineering

And query the set to find connected components # Include Stdio. h > Int Set [ 1001 ]; Int Find ( Int X ){ While ( Set [X] ! = X)X = Set [X]; Return X;} Void Merge ( Int X, Int Y ){ Int FX, FY;FX = Find (X

PKU 2352 stars

# Include Iostream > # Define Maxn 15000 # Define Maxcompute 32002 Using   Namespace STD; IntStar [Max]={0};IntEv [maxn]={0}; IntLowbit (IntN){ReturnN&(-N );} Int Sum ( Int N){ Int R =   0 ; While (N ! =

PKU 1006 biorhythms

# Include Iostream > Using   Namespace STD; IntM [3]={23,28,33}, [3], Now; Int Exgcd ( Int A, Int B, Int   & X, Int   & Y){ If (B =   0 ){X =   1 ;Y =   0 ; Return A;} Int R = Exgcd (B, % B, x, y );

HDU 2111 saving HDU

Apparently greedy # Include Stdio. h > # Include Iostream > # Include Vector > # Include Algorithm > Using Namespace STD; Struct Baobei { Int P, M; Double Val;}; Bool CMP ( Const Baobei & A, Const Baobei &

POJ 1190 birthday cake DFS + pruning

Do you feel this way... Conversion from http://hi.baidu.com/%8E%E1%D0%B3/blog/item/2f1d8f4c176a8dc4d1c86af9.html below But he wrote the wrong one. Changed Because the depth is certain (m), we use depth-first search to set the cake serial number

Poj 2367 Genealogical tree

The raw Topology Sorting chart is represented by an adjacent table. The method is dfs. #include#includeconst int MAXN = 1000;struct edge{int u, v, next;}e[MAXN];int n;int first[MAXN], cnt;bool visit[MAXN], f;int sort[MAXN], top;void dfs(int

PKU 1042 Gone Fishing

# Include # Include # Define MAXN 26 Using namespace std; Int main (){Int n, h, tmp, sum, max;Int I, j, k, p;Int F [MAXN], f [MAXN], d [MAXN], t [MAXN] = {0}, ans [MAXN], ANS [MAXN];While (scanf ("% d", & n )! = EOF & n){Scanf ("% d", & h );H * =

Maximum stream Algorithm for Maximum Flow

  Algorithm name Complexity Summary Zengguang road MethodAugmenting path method (Ford Fulkerson method) General augmented Path AlgorithmLabeling algorithm O (nmU) In the residual network, you can find an

PKU 1149 PIGS

# Include # Define maxn1102 Using namespace std; Int C [MAXN] [MAXN];Int F [MAXN] [MAXN];Int P [MAXN];Int M [MAXN];Int PIG, REN;Int S, T; Void dfs (int u){For (int I = 0; I If (P [I] =-1 & C [u] [I]> F [u] [I]){P [I] = u;M [I] = min (M [u], C [u] [

Total Pages: 64722 1 .... 54788 54789 54790 54791 54792 .... 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.