The well known Hollywood student Greenlight Casting Couch is releasing one of their hits in a directors cut edition.  The editor starts with the scenes in the orginal order and repeatedly swaps pairs of scenes until they are in the new order. Given the order of the scenes in the old and new versions of the film.  Write a program to determine the smallest number of swaps required to edit the film.


Taken from the 2005 Informatics Olympiad.  

Click here to view all the competition tasks. 

© British Informatics Olympiad


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.