Page 2 of 2

Re: Problem 212

Posted: Sat Nov 20, 2010 4:35 am
by sivakd
Lord_Farin wrote:You may want to notice that the volume of a cuboid is not the same as the amount of lattice points contained in it. That is what led to your confusion, I believe. Since planes have volume zero in 3D, it does not matter if we include the boundary of the cuboid or not: the volume stays the same.
Lord_Farin, thanks for the explanation. I am somehow still not convinced. Put it differently two solid objects can occupy the same point as per this definition if they are adjacent.

Re: Problem 212

Posted: Sat Nov 20, 2010 5:29 am
by TripleM
Sure they can - there is a lot of overlapping of cuboids in this problem, which is the point (to calculate the volume of the union). The problem doesn't say the cuboids can't share points (in fact, if they couldn't, the problem would be trivial, since you'd just add the volumes of each cuboid).

If you were asked to draw a lot of squares on a piece of paper then calculate the area of the union, it doesn't make a difference whether you include the edges or not - the area is the same. And there will definitely be squares sharing the same points. Exactly the same here, but with cuboids.

Re: Problem 212

Posted: Sat Nov 20, 2010 7:56 am
by sivakd
Thanks Guys, working on a problem till late into the night can make you dumb :).

Re: Problem 212

Posted: Tue Nov 01, 2011 11:20 pm
by OskarS
I've figured out an algorithm for this problem, and the code I wrote gives the correct answer for n=100 and for n=1579 that was provided earlier in this thread, but it gives the wrong answer for the full n=50000 problem. Could I message someone here with some other values, just to see if I can figure out where I'm going wrong?

Re: Problem 212

Posted: Wed Nov 02, 2011 10:45 pm
by OskarS
Nevermind, I figured out what I was doing wrong and I've solved it now :)