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 1212. Battleship

Help! Why WA at 4?(+)
Posted by SPIRiT 1 Sep 2006 15:56
My idea of the problem was the following:
1) I know, how many K-ships can be placed on the FREE board.
It's a rather simple formula
2) After that I check each placed ship. For him I found all the K ships that cannot be placed on the board thanks to this ship and add them to the special array (if they aren't there already). After that I subtract the number of elements in the array out of FREE board amount and that's the answer.
Who can give me test 4?
Sorry, stupid mistake...
Posted by SPIRiT 1 Sep 2006 16:06
I didn't think about the case K=1. But now I fixed it and have WA 11. What's that test about?
Re: Sorry, stupid mistake...
Posted by Partisan 15 Jun 2009 16:58
Maybe you don't check when n<k or m<k (than common formula return incorrect value)
Re: Sorry, stupid mistake...
Posted by Dmitriy 1 May 2012 20:47
excuse me, can give me test 4?