How to solve the shortest Short Circuit in HDU Graph Theory

Source: Internet
Author: User

Hdu1385: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1385

This question is to let you find the minimum cost. What is more difficult is that it is not only the Shortest Path of the edge weight value, but also the Shortest Path of the Edge Weight Value + vertex weight value, in fact, you just need to add steps. The key here is to record the path, because the question requires you to output it in Lexicographic Order, for example, path 1--3--4--5 and path 1-2--3--4. If the two paths are the same, output the latter. Because it is in the Lexicographic Order, we need to record the successor of the vertex when recording the path, rather than the precursor of the vertex. Once we record the precursor of the vertex, some situations may lead to errors. This requires careful consideration.


Hdu2807: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2807

This is also the most short-circuit problem, mainly the problem of Matrix Multiplication. The product of two matrices is obtained in a general way, and its efficiency is very low, so the efficiency of converting a two-dimensional matrix into a one-dimensional matrix is much faster, and then it is the simplest and most short-circuit problem.


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.