Sicily 1827 & 1947 sniper

// Calculate the minimum cut and convert it to the maximum flow model to find the maximum flow // The method of the diagram is split point, change one vertex except the Source Vertex and the sink vertex to two. The capacity of each vertex is the

Poj 1459 Power Network (network stream-maximum Stream)

// Network stream-maximum stream // Add the virtual source point and virtual sink point diagram, convert to the shortest path from source to sink # include # include # include # define INF 2000000000 using namespace STD; int N, NP, NC, M;

Sicily 1696 flows in Grid (maximum Stream)

// Because the given point can reach a maximum of 100*100 = 10000 // it is impossible to create a 10000*10000 graph to describe the traffic, MLE // but considering the shape of a grid, each vertex can be connected only to a maximum of four

Sicily 1114 food cube (BFS breadth-first search)

// BFS breadth-first search // after creating a graph, perform extensive search for all null values in the graph, which is equivalent to expanding from the change point, until a cube or cross-border query is triggered // each time a coordinate is

Poj 2182 lost cows (line segment tree)

// Line segment tree // question: determine the sequence number of the given series, and then determine the arrangement of the series // thought: reverse thinking, for the given N number, starting with the number of N, if the number of his

Poj 2828 buy tickets (line segment tree)

// The Line Segment tree uses the flexibility of the Line Segment tree to implement queuing // algorithm key: backward insertion. The line segment tree maintains the remaining valid space in the interval, each time a proper position is found in the

Poj 2777 count color (line segment tree + bit operation optimization)

// Line segment tree // A has gained a lot. At first, I won't use bitwise operations. The vis [30] array is used to mark colors one by one, slow speed: 800 + Ms // The color is recorded by bitwise operations, and the result is doubled // pass

Sicily 1090 highways (Kruskal minimal spanning tree)

// Find the maximum edge in the minimal spanning tree // write the Kruskal Algorithm for the first time. Thanks to the guidance of jsh // check the superiority of the set, after the split, only the time of O (1) is required to obtain the result //

Poj 1149 (network stream-maximum Stream)

Http://imlazy.ycool.com/post.2059102.html I read this article and learned a lot about it. I worship God! The difficulty of network flow lies in the Construction of graphs and the simplification of graphs. // Network stream -- maximum stream // The

Poj 1661 help Jimmy (Dynamic Planning)

// Dynamic planning // sort the Board by height // records the minimum time required to reach the Left and Right endpoints of each board, and the next board pointer for each board to jump down from the left and right sides // the minimum time

Sicily 1146 drug collection (DP dynamic planning-01 backpack problem)

// Traditional non-scrolling Array Implementation form # include # include using namespace STD; int s [1000] [1000]; int main () { int T, M, T, V, _ max =-1; // T is the maximum time (Backpack capacity), and m is the number of herbs (total

Sicily 1154 easy sort (SORT)

// Simple and fast sorting. It turns out that algorithm was added with qsort on Sicily. It's no wonder that an error occurred while using next_permutation during the school competition. It turns out that was not added! Not experienced enough !! //

Poj 2524 ubiquitous religions (query set)

// Simple application for querying sets -- compress paths and query sets // After analysis, each point can be traversed once and the corresponding query set can be created, the search complexity is O (1); // calculate the number of

Poj 1308 is it a tree (simulation)

// The simplest method is to define the tree. // The tree has n vertices, n-1 edge // I think this question is more than the street, the data range is not given, the details so much, consider empty tree and multiple sides. # include using

Original Steve Jobs speech at Stanford University

Stanford Report, June 14,200 5 'You ve got to find what you love, 'Jobs says This is the text of the commencement address by Steve Jobs, CEO of Apple Computer and of Pixar Animation Studios, delivered on June 12,200 5. I am honored to be with you

Ten brilliant questions about intelligence. How many questions will you do?

I hope you will enjoy it ~ 1. Give a blind man 52 cards and tell him that exactly 10 cards are facing up. The blind man was asked to divide the card into two heaps, so that there were as many cards in each heap. What should blind man do? 2. How to

Poj 1008 Maya calendar (simulation | date calculation)

// A very good question. Ignore the details wa Three Times // pay attention to special cases // if it is the last day of the year, note that the year must be reduced by 1 // conclusion: When performing a modulo operation, consider whether the

Poj 1028 Web navigation

DescriptionStandard Web browsers contain features to move backward and forward among the pages recently visited. one way to implement these features is to use two stacks to keep track of the pages that can be reached by moving backward and forward.

Uvaoj 340 master-mind hints

Mastermind is a game for two players. One of them,Designer, Selects a secret code. The other,Breaker, Tries to break it. A code is no more than a row of colored dots. At the beginning of a game, the players agree upon the lengthNThat a code must

Poj 2503 babelfish (hash)

// Simple dictionary hash application, which can also be used by trie // learned how to use sscanf, the difficulty lies in reading data. # include using namespace STD; const int maxhash = 100003; int head [maxhash], next [maxhash]; int m;

Total Pages: 64722 1 .... 56225 56226 56227 56228 56229 .... 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.