英語翻譯
英語翻譯
David hates to wait at stop signs,yield signs and traffic signals while driving.To minimize this aggravation,he has prepared maps of the various regions in which he frequently drives,and measured the average delay (in seconds) at each of the various intersections in these regions.He wants to find the routes between specified points in these regions which minimize his delay at intersections (regardless of the total distance he has to drive to avoid delays),and has enlisted your assistance in this effort.
Input
For each region,David provides you with a map.The map data first identifies some number of intersections,NI.The regions never include more than 10 intersections.The intersections in each region are numbered sequentially,starting with the number one (1).For each intersection,in turn,the input then specifies the number of streets leading away from the intersection,and for each such street,the number of the intersection to which the street leads,and the average delay,in seconds,that David encounters at that intersection.Following the data for the last intersection in a region there appear the numbers associated with the intersections where David wants to start and end his drive.The entire input consists of a sequence of maps,followed by the single integer zero (0).
Output
For each region,in order,print a single line of output which contains the region number (they,too,are sequentially numbered,starting with 1),a list of the intersection numbers David will encounter in the route with minimum average delay,and the average number of seconds he will be delayed while travelling this route.A suitable format is shown in the example below.
Notes
There will always be a unique route with the minimum average delay in each region.
A street from intersection I to intersection J is one-way.To represent a two-way street from I to J,the map must also include a route from intersection J to intersection I.
There will never be more than one route directly from intersection I to intersection J.
Example
Suppose David wants to travel from intersection 2 to intersection 4 in the region shown in the following map:
David hates to wait at stop signs,yield signs and traffic signals while driving.To minimize this aggravation,he has prepared maps of the various regions in which he frequently drives,and measured the average delay (in seconds) at each of the various intersections in these regions.He wants to find the routes between specified points in these regions which minimize his delay at intersections (regardless of the total distance he has to drive to avoid delays),and has enlisted your assistance in this effort.
Input
For each region,David provides you with a map.The map data first identifies some number of intersections,NI.The regions never include more than 10 intersections.The intersections in each region are numbered sequentially,starting with the number one (1).For each intersection,in turn,the input then specifies the number of streets leading away from the intersection,and for each such street,the number of the intersection to which the street leads,and the average delay,in seconds,that David encounters at that intersection.Following the data for the last intersection in a region there appear the numbers associated with the intersections where David wants to start and end his drive.The entire input consists of a sequence of maps,followed by the single integer zero (0).
Output
For each region,in order,print a single line of output which contains the region number (they,too,are sequentially numbered,starting with 1),a list of the intersection numbers David will encounter in the route with minimum average delay,and the average number of seconds he will be delayed while travelling this route.A suitable format is shown in the example below.
Notes
There will always be a unique route with the minimum average delay in each region.
A street from intersection I to intersection J is one-way.To represent a two-way street from I to J,the map must also include a route from intersection J to intersection I.
There will never be more than one route directly from intersection I to intersection J.
Example
Suppose David wants to travel from intersection 2 to intersection 4 in the region shown in the following map:
英語人氣:176 ℃時間:2020-06-20 15:04:21
優(yōu)質(zhì)解答
大衛(wèi)討厭等待停止的跡象,產(chǎn)量標(biāo)志和交通信號,而駕駛.為了盡量減少這種惡化,他已經(jīng)準(zhǔn)備地圖,各地區(qū),他經(jīng)常驅(qū)動器和測量的平均延遲時間(以秒為單位)在各個不同的十字路口在這些地區(qū).他希望找到指定的路線點之間在這...
我來回答
類似推薦
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- a little love這首歌所表達(dá)的意思是什么?
- 拋物線y=x平方-3x-10與x軸相交于點A和B 在x軸下方的拋物線上有一點P 設(shè)三角形ABP面積為S 則S最大值?
- they are all places of great interest.of great interest.為什么這么用,他在這里作什么作用.
- K為何值時,方程組
- 一種電腦,如果減少定價的百分之十出售,可盈利215元;如果減少定價的百分之二十,虧本125元.進(jìn)價多少元
- 設(shè)函數(shù)f(x)=4sin(2x+1)-x,則f(x)的零點個數(shù)有幾個?
- 商場舉行促銷活動,某種洗衣機(jī)每臺按2400元出售獲利潤20%,如果按原來得標(biāo)
猜你喜歡
- 1等我明白了什么是愛,你卻已離開(或者是 不在). 這句話翻譯成英文,優(yōu)美一點…
- 2歷史上除了諸葛亮外,還有誰“受任于敗軍之際,奉命于危難之間”?
- 3圓錐和圓柱半徑的比是3:2,體積的比是3:4,那么圓錐和圓柱高的比是_.
- 4長江起源于哪個省
- 5已知A={y/y=x的平方-4x+3,x∈R},B={y/y=x的平方-2x+2,x∈R},則A交集B等于( ).
- 6摩擦生熱的同時也起電了嗎?不是說摩擦生熱,也有摩擦起電嗎
- 7分子加5等于1/2,分母減3等于1/3求這個分?jǐn)?shù),要用二元二次方程
- 81_____is te second month of a year.2His b_____is october 3rd.空格應(yīng)填什么?
- 9數(shù)列題:1/9,1,7,36下一個是什么?
- 10機(jī)械設(shè)計,現(xiàn)要設(shè)計一容器,容器中的溶劑,在工作時溫度保持在一定攝氏度
- 11衍射光柵中,如何將相鄰兩條光譜分的更開些
- 12小明學(xué)習(xí)了電學(xué)知識后,想知道家里有一臺電磁爐的電率,他利用了接在他家電路里的一個電能表來測量 除了電