Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Collecting Beepers
Description Karel is a robot who lives in a rectangular coordinate system where each place is designated by a set of integer coordinates ( Karel can only move along the x and y axis, never diagonally. Moving from one position ( You can assume that Karel’s world is never larger than 20 × 20 squares and that there will never be more than 10 beepers to pick up. Each coordinate will be given as a pair ( Input First there will be a line containing the number of scenarios you are asked to help Karel in. For each scenario there will first be a line containing the size of the world. This will be given as two integers ( Output The output will be one line per scenario, giving the minimum distance that Karel has to move to get from her starting position to each of the beepers and back again to the starting position. Sample Input 1 10 10 1 1 4 2 3 5 5 9 4 6 5 Sample Output The shortest path has length 24 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator