[kuangbin带你飞]专题四 最短路练习 F - Wormholes

这篇博客探讨了在FJ的农场中存在的一种特殊的一向路径——虫洞,它可以将旅行者带到过去。FJ希望从某个字段出发,通过路径和虫洞旅行,并在初始出发时间之前返回。博客提供了包含多个农场地图的信息,每个农场包括字段数量、路径数量和虫洞数量,并给出了路径和虫洞的旅行时间。任务是判断FJ是否可能实现他的时间旅行目标。输入描述了农场数量及每个农场的详细路径和虫洞信息,输出需要对每个农场判断是否可行并给出“YES”或“NO”的答案。
摘要由CSDN通过智能技术生成

POJ - 3259

While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is BEFORE you entered the wormhole! Each of FJ's farms comprises N (1 ≤ N ≤ 500) fields conveniently numbered 1..NM (1 ≤ M ≤ 2500) paths, and W (1 ≤ W ≤ 200) wormholes.

As FJ is an avid time-traveling fan, he wants to do the following: start at some field, travel through some paths and wormholes, and return to the starting field a time before his initial departure. Perhaps he will be able to meet himself :) .

To help FJ find out whether this is possible or not, he will supply you with complete maps to F (1 ≤ F ≤ 5) of his farms. No paths will take longer than 10,000 seconds to tra

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值