ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1115. Ships

Can I use recoursive search ? Help me please
Posted by Dostoyevsky 31 May 2006 04:34
My algorithm is follow.
1.I'm starting to put ships to the most short row ( ships are sorted from shortest to longest and I'm considering them in this order ).
2.I'm trying to put ships with maximum total length as it is possible. So, recoursive searching ( from longest free ships to shortest ) take place.
3.If all ships are already used and there are still free row(s), I put at this row(s) some ship(s) from other row(s) which have already more then one ship.

Please, give me some test data or tell me why does such algorithm return WA.

Edited by author 01.06.2006 19:20