Wormholes
Time Limit: 2000MS | Memory Limit: 65536K | |
Total Submissions: 59753 | Accepted: 22349 |
题目链接:点击打开链接
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! Each of FJ's farms comprises N (1 ≤ N ≤ 500) fields conveniently numbered 1..N, M (1 ≤ M ≤ 2500) path