USACO 2004 February Green Distance Queries

农夫John的奶牛因为马拉松路线太长而拒绝参加。他需要找到一条更合理的路径。输入包括“Navigation Nightmare”的格式,后面跟着一个整数K(查询数量),然后是K条距离查询。每条查询包含两个农场的编号,要求计算这两个农场之间的路径长度。输出每个查询的距离。
摘要由CSDN通过智能技术生成

题目描述

Farmer John's cows refused to run in his marathon since he chose apath much too long for their leisurely lifestyle. He therefore wants to find apath of a more reasonable length. The input to this problem consists of thesame input as in "Navigation Nightmare",followed by a line containinga single integer K, followed by K "distance queries". Each distancequery is a line of input containing two integers, giving the numbers of twofarms between which FJ is interested in computing distance (measured in thelength of the roads along the path between the two farms). Please answer FJ'sdistance queries as quickly as possible!

 输入

* Lines 1..1+M: Same format as "Navigation Nightmare" *Line 2+M: A single integer, K. 1 <= K <= 10,000 * Lines

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值