题意:John的农场里n块地,m条路连接两块地,k个虫洞,虫洞是一条单向路,不但会把你传送到目的地,而且时间会倒退Ts.我们的任务是知道会不会在从某块地出发后又回来,看到了离开之前的自己. 思路:虫洞连接的边是负权值的,如果途中存在一个负环的话,他可以沿着这个换一直走,时间肯定为负值. #include<string.h> #include<stdio.h> const int N=510; const int inf=0x3fffffff; int start,num,n,dis…
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 34934 Accepted: 12752 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…
题目链接:http://poj.org/problem?id=3259 Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 45077 Accepted: 16625 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is ver…
Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 24249 Accepted: 8652 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 pa…
POJ 3259 Wormholes Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu 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…