Bzoj1001 [beijing2006] Wolf catch rabbit

Source: Internet
Author: User

At a glance, the minimum cut is converted to the maximum stream.

Then we found that the number of points reached 10 ^ 6, so we had to think further.

According to a large number of questions on the Internet, the maximum stream of an image is equal to the shortest path of its dual graph, so Dijkstra is enough.

Creating a graph is a bit disgusting... It took a long time to query...

 

  1 /**************************************************************  2     Problem: 1001  3     User: rausen  4     Language: C++  5     Result: Accepted  6     Time:520 ms  7     Memory:94588 kb  8 ****************************************************************/  9   10 #include <cstdio> 11 #include <cstring> 12 #include <algorithm> 13 #include <queue> 14   15 using namespace std; 16   17 struct edges{ 18     int next, to, v; 19 } e[6000005]; 20   21 struct heap_node{ 22     int v, to; 23 }; 24 inline bool operator < (const heap_node &a, const heap_node &b){ 25     return a.v > b.v; 26 } 27   28 priority_queue View code

 

Bzoj1001 [beijing2006] Wolf catch rabbit

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.