HDU 3938 Portal

Source: Internet
Author: User

Portal

Time limit:2000/1000 MS (java/others) Memory limit:65536/65536 K (java/others) total submission (s): 1312 Accepted Submission (s): 656

problem DescriptionZlgg found a magic theory that the bigger banana the bigger banana peel. This important theory can and him make a portal with our universal. Unfortunately, making a pair of portals would cost min{t} energies. T in a path between point V and point U are the length of the longest edge in the path. There may lots of paths between, points. Now ZLGG owned L energies and he want to know how many kind of the path he could make. InputThere is multiple test cases. The first line of input contains three integer N, M and Q (1 < n≤10,000, 0 < m≤50,000, 0 < q≤10,000). N is the number of points, M is the number of edges and Q are the number of queries. Each of the next M lines contains three integers a, B, and C (1≤a, b≤n, 0≤c≤10^8) describing an edge connecting th E Point A and B with cost C. Each of the following Q lines contain a single integer L (0≤l≤10^8). OutputOutput The answer to all query on a separate line. Sample Input Ten Ten7 2 16 8 34 5 85 8 22 8 96 4 52 1 58 57 3 77 8 8Ten615918276 Sample Output $ -1 - $1 $2 - -

HDU 3938 Portal

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.