marmay

# marmay - Sheet1 Page 1 Marriage Mayhem Alex and Betty are...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sheet1 Page 1 Marriage Mayhem-------- ------ Alex and Betty are soon to be married, but have each forgotten a crucial item at home. They must each collect their item before the wedding may take place thus they wish to arrive there as soon as possible. However, as tradition has it that the bride and groom must not meet before the wedding, they must take care to avoid running into each other. Being decent people, their world consists of a graph. The problem will specify Alex and Betty's start and target vertices. Traversing an edge will take one second. (It is also allowed to stand still at a vertex.) It is not allowed for Alex and Betty to:-- be at the same vertex at the same time-- traverse the same edge at the same time. Your job is to compute the earliest time at which both Alex and Betty can be home, or to say that no solution is possible. i Input----- For each test case, the input is: Line 1: 5 integers: the number of vertices N Alex's start vertex `as' and finish vertex `af' Betty's start vertex `bs' and finish...
View Full Document

## This note was uploaded on 04/29/2011 for the course IT 201 taught by Professor K.v.arya during the Spring '11 term at IIT Kanpur.

### Page1 / 2

marmay - Sheet1 Page 1 Marriage Mayhem Alex and Betty are...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online