编程介的小学生 2019-05-01 15:52 采纳率: 20.5%
浏览 208

道路节点的最小花费的一个算法问题,怎么采用C语言的程序的代码实现的?

Problem Description
Windy August like to fly in the sky ,together with the wind.But she will feel very tired after a long-time-flying,so she usually choose to walk.

Now there are n sights,and there are m roads between some of the sights.The roads are described in the format like (a,b,c,d,w),saying that there are roads between every nodes (x,y) ,a≤x≤b,c≤y≤d,and the cost of the roads are w.Windy August will start off at the nodes numbered 1,and she will go to the node numbered n.She can fly k times every day,if she decide to fly in road (u,v,w),she will go to vfrom u with 0 cost.

Please output the minimum cost from node 1 to node n.

Input
The first line has a number T,means test case.(For some reasons,T=1.)

The next line is 2 numbers n,m.

Next is m line,there are 5 numbers in every line,which means (a,b,c,d,w).

T=1,1≤n≤5∗104,1≤m≤104,0≤k≤10,1≤w≤103.

Output
Only 1 number in 1 line,which means the minimum cost.

If node 1 and node n are disconnected,output "CreationAugust is a sb!".

Sample Input
1
5 3 0
1 2 4 5 42
5 5 4 4 468
1 1 3 3 335

Sample Output
42

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!