We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #126: Cuboid layers
Project Euler #126: Cuboid layers
Sort by
recency
|
10 Discussions
|
Please Login in order to post a comment
First part is to find formula for number of cubes in given layer. Then we need to calculate min and max values for formula factors. Then we need to calculate posible range of sum of two factors and solve for integer solutions of quadratic equations in the equation: A = B(x+y) + xy where x+y has relatively small range of values. For N=1000000 my algorithm takes about 70 ms.
hi how to provide input to this solution
I can't manage to get it to run in time :C Any tips? So far I found the general and I'm just passing it layer, height, depth and width and add one to the amount of cubs found with the result's cubes. I did a very, very optimized version of that, but it doesn't run on time so I guess there is something I'm not catching. Any leads? Thanks.
can someone explain how c(154)=10
can someone give me a hint on how the calculation did on the 3x2x2? because my algorithm gives me 32 cubes to fully cover this, while one the problem page it says 46. by the way my algorithm for this: 2*(x*y + y*z + z*x), x,y,z is the with, height and depth of the object.