11
From AZSPCS:
Suppose you have a deck containing n cards. Each card contains a number from 1 to n, and each number appears on exactly one card. You look at the number on the top card -- let's says it's k -- and then reverse the order of the top k cards. You continue this procedure -- reading the top number and then reversing the corresponding number of cards -- until the top card is 1.
Write the fastest program to compute the number of reversals for a given deck. Note that if you are participating in the contest you are not allowed to post your code (and thus I will not post my code yet).
What is the input/output model? Any language restrictions? How will you determine how fast each entry is? – aaaaaaaaaaaa – 2011-01-28T02:24:07.010
So are we allowed to post solutions or not? – AShelly – 2011-02-09T16:25:10.380
Yes. The contest has finished. – Alexandru – 2011-02-13T11:42:44.593
There could be a dedicated stackexchange for azspcs ;) – Eelvex – 2011-01-30T23:22:44.457
The link to azspcs links to a page which is out of order. And it seems a meta-tag, which doesn't describe the puzzle. The tag should, perhaps, be removed. – user unknown – 2011-05-01T01:42:47.020