1 / 7
Dec 2004

It is written in problem statement, that "there are no more than 2 blocks of each color".

But in sample input there is a color matrix

1 2 3
1 1 1
1 1 1

where there are 7 blocks with color 1.

Is everything correct?

  • created

    Dec '04
  • last reply

    Jan '05
  • 6

    replies

  • 419

    views

  • 5

    users

  • 1

    link

The example indeed didn't comply to the restrictions in the description. Thanks, I've fixed it.

1 month later

I can see that Tomek Czajka solved the problem first.
Congratulations!

I have a question:
Can there be a simpler version of the problem put on SPOJ, where the colors are all different. I think I can solve it then and It could be an easier start for BLOCKS if I could test my ideas on the simpler version.

Best regards,
Adam

Thanks!

Test your ideas theoretically! smile

This was a great problem to spend hours thinking about, thanks problemsetters!

Our pleasure smile, glad you enjoyed solving it.

Perhaps it will be done one day. But there really isn't much to test in the simpler version - if you know you can solve it, then you can smile.
If you are in doubt, I think that a very simple random test case generator is enough to verify your ideas (I used this code1 for some of the test data). Run with e.g.: echo "20 400 10 0 1 100 " | ./blockgen to obtain a test case for the simpler version of the problem.

Please, tomek, can you tell me something about your idea?