会了spfa这么长时间竟然不会判断负环,今天刚回.. [例题]poj3259 题目大意:当农场主 John 在开垦他的农场时,他发现了许多奇怪的昆虫洞.这些昆虫洞是单向的,并且可以把你从入口送到出口,并且使得时间倒退一段时间. John 的每个农场包含 N(1≤N≤500)块地,编号从 1-N,这 N 块地之间有 M(1≤M≤2500)条路. W(1≤W≤200)个昆虫洞.因为 John 是一个狂热的时间旅行迷,他想尝试着做这样一件事:从某块地出发,通过一些路径和昆虫洞,返回到出发点,并且时间早
Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 36860 Accepted: 13505 Description 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 p
Description 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! Eac