### 10861 - Security by Ambiguity

Posted:

**Fri Aug 11, 2006 6:05 am**I was trying to solve this problem but could not get any clue. Can anyone help me ?

The Online Judge board

https://uva.onlinejudge.org/board/

https://uva.onlinejudge.org/board/viewtopic.php?f=30&t=11521

Page **1** of **1**

Posted: **Fri Aug 11, 2006 6:05 am**

I was trying to solve this problem but could not get any clue. Can anyone help me ?

Posted: **Thu May 31, 2007 12:34 pm**

To solve this problem, my advise is:

1. Think about what the problem really is about. It took me about 2 years to get the right idea (but I might not be one of the brightest in this department).

2. Once you have the idea, try to implement it. In principle you could cram the lot in a few recursive functions, but my advise is to solve it step by step, wasting lots of memory to store intermediate results, and lots of cycles to generate and print debugging information.

3. Once you got it running you'll most likely get WA because you overlooked some details and/or made some tiny implementation errors. Hunt for the original test data (it's somewhere on a Swedish site, along with the authors' solution and a description of the method in Swedish).

4. Debug your code on an almost case-to-case basis. Expect to make lots of debugging cycles; by solving one problem you might introduce wrong answers for cases that previously were correct for the wrong reason. Some basic drawing skills come in very handy in this phase (if you understand the problem, it is a lot easier to hand-calculate the answer from the drawing, than it is to make your code give the same answer).

5. If you got your code accepted by now, that's great. If not, wait a few months and start all over at step 1. Or you can consider giving up all together and find another nice hobby, like bird watching or stamp collecting (or shoveling snow, if you are in a Nordic country).

Anyways Per: a very, very nice problem, really. But did you truly expect anyone to solve it in the course of a single contest?

1. Think about what the problem really is about. It took me about 2 years to get the right idea (but I might not be one of the brightest in this department).

2. Once you have the idea, try to implement it. In principle you could cram the lot in a few recursive functions, but my advise is to solve it step by step, wasting lots of memory to store intermediate results, and lots of cycles to generate and print debugging information.

3. Once you got it running you'll most likely get WA because you overlooked some details and/or made some tiny implementation errors. Hunt for the original test data (it's somewhere on a Swedish site, along with the authors' solution and a description of the method in Swedish).

4. Debug your code on an almost case-to-case basis. Expect to make lots of debugging cycles; by solving one problem you might introduce wrong answers for cases that previously were correct for the wrong reason. Some basic drawing skills come in very handy in this phase (if you understand the problem, it is a lot easier to hand-calculate the answer from the drawing, than it is to make your code give the same answer).

5. If you got your code accepted by now, that's great. If not, wait a few months and start all over at step 1. Or you can consider giving up all together and find another nice hobby, like bird watching or stamp collecting (or shoveling snow, if you are in a Nordic country).

Anyways Per: a very, very nice problem, really. But did you truly expect anyone to solve it in the course of a single contest?

Posted: **Thu May 31, 2007 1:31 pm**

I don't think so. When he gave me this problem, he indirectly gave me a hint that this one would remain untouched. And right he was!!little joey wrote: Anyways Per: a very, very nice problem, really. But did you truly expect anyone to solve it in the course of a single contest?

Problem F of NG1 ... Stats