Problem 011

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Seahawk
Posts: 8
Joined: Sat Dec 18, 2010 3:25 am
Location: US of A's
Contact:

Re: Problem 11

Post by Seahawk »

Thanks lol. Well here is what I have got so far. And I think this is all the helper methods I will need. Blank it out if needed but it is just the multi-dimensional array and the methods.
Expand
[code]
snip[/code]
Last edited by rayfil on Sat Apr 16, 2011 1:41 am, edited 1 time in total.
Reason: The posted code should have been snipped before.
Image
13 year old C# Programmer
Seahawk
Posts: 8
Joined: Sat Dec 18, 2010 3:25 am
Location: US of A's
Contact:

Re: Problem 11

Post by Seahawk »

Also I keep getting this answer is it close?
Expand
51267216
I just tried another method of suppressing errors when I went out of range of the index so any other suggestions.
Image
13 year old C# Programmer
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 11

Post by hk »

You're forgetting that there is a second type of diagonal, going from top right to bottom left.
And I'm not sure why you have a go-up and go-down method.
Image
War ruins the life and health of untold numbers of innocent children.
Seahawk
Posts: 8
Joined: Sat Dec 18, 2010 3:25 am
Location: US of A's
Contact:

Re: Problem 11

Post by Seahawk »

Thank you so much! I will test it now! :)
Image
13 year old C# Programmer
Seahawk
Posts: 8
Joined: Sat Dec 18, 2010 3:25 am
Location: US of A's
Contact:

Re: Problem 11

Post by Seahawk »

I got it! You are the shizzle my nizzle! You can close if you want. :)
Image
13 year old C# Programmer
BevPoseidon
Posts: 2
Joined: Fri Feb 18, 2011 5:54 pm

Problem 11

Post by BevPoseidon »

I have been staring at my code for the past hour trying to see where I made an error, but no go :(

I get the answer: 51267216
but that is wrong.

If anyone can see something wrong with my code, that would be a big help!

***CODE DELETED*** (Sorry, can't share the answer!)

I imported the grid from a text file for neatness.
Last edited by BevPoseidon on Fri Feb 18, 2011 6:58 pm, edited 1 time in total.
BevPoseidon
Posts: 2
Joined: Fri Feb 18, 2011 5:54 pm

Re: Problem 11

Post by BevPoseidon »

Ahh, i found the problem. I new going away from the computer and coming back in an hour would do it ;)

This line:
productDiagonalLeft = grid [x] [y] * grid [x - 1] [y - 1] * grid [x - 2] [y - 2] * grid [x - 3] [y - 3];

should be:
productDiagonalLeft = grid [x] [y] * grid [x - 1] [y + 1] * grid [x - 2] [y + 2] * grid [x - 3] [y +3];


WOOt
Cruncher2
Posts: 2
Joined: Tue Apr 05, 2011 3:54 pm

Problem 11

Post by Cruncher2 »

i'm getting 5XXXXXXX (avoiding spoiler, even though the result is wrong)

and it's still wrong which is confusing me because i have proof-read my code 100 times, and even manually combed the grid, and that's the only product i can find that is even over 50000000
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 011

Post by rayfil »

Please don't create a new topic when one already exists. You may even find an answer to your problem in the existing one.

I do realize its your first post. Problem numbers below 100 have leading zeros on this forum.
When you assume something, you risk being wrong half the time.
mulehack
Posts: 1
Joined: Fri Apr 15, 2011 10:43 pm

Re: Problem 011

Post by mulehack »

I've got the same problem as Cruncher, getting the 5xx number.

I'm quite certain I understand the problem and I've proof read my code many times.. but alas... I actually think there might be a bug on the site when you enter your answer :S. So, my code is in Java I thought I might post it in order to get some help :}
So did you not read the forum rules in big red letters at to top of the page? Please edit your post to remove the code and your description of your solution.
As for your error - how many diagonals does a square have?
I thought they would be hidden just as the other code snippets in previous posts :L
:C my apologies
but more importantly, thanks for the help <3
Last edited by mulehack on Sat Apr 16, 2011 12:12 am, edited 2 times in total.
User avatar
jaap
Posts: 588
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 011

Post by jaap »

mulehack wrote:So, my code is in Java I thought I might post it in order to get some help :}
So did you not read the forum rules in big red letters at to top of the page? Please edit your post to remove the code and your description of your solution.
As for your error - how many diagonals does a square have?
User avatar
Otherworld
Posts: 3
Joined: Mon Apr 25, 2011 10:49 am

Re: Problem 011

Post by Otherworld »

mulehack wrote:So, my code is in Java I thought I might post it in order to get some help :}
You already know you're not aloud to do that. But, if you want, you can send your code to me and I'll see what's wrong.
Btw, this one is very simple, since it is only 20x20 grid. You can even bruteforce it :D
Image
User avatar
formicFabricant
Posts: 3
Joined: Fri Mar 25, 2011 4:00 pm

Re: Problem 011

Post by formicFabricant »

Otherworld wrote:
mulehack wrote:So, my code is in Java I thought I might post it in order to get some help :}
You already know you're not allowed to do that. But, if you want, you can send your code to me and I'll see what's wrong.
Btw, this one is very simple, since it is only 20x20 grid. You can even bruteforce it :D
If by brute force you mean look for high numbers yourself and multiply them on a scrap of paper. Surely I'm not the only one who got this without code (and on the first guess)?
User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 10:43 am
Location: Netherlands

Re: Problem 011

Post by Lord_Farin »

In your reply, I taste the assumption that if he meant something different with 'brute force', he could not have solved the problem therewith. However, I strongly suspect that by 'brute force' he means using the computer's massive iteration power to exhaust all possibilities (by going through each and every one of them).
The latter I agree on. See e.g. this problems discussion forum on the main site.
Image
slindeneau
Posts: 4
Joined: Thu Jun 16, 2011 12:34 am

Re: Problem 011

Post by slindeneau »

I recognize (now) that the problems title accurately states that they need to be in a straight line. However the problem text itself does not stipulate this. Quite frustrating to solve the more generic problem of adjacent numbers only to realize that only the more specific problems answer is the actual problem.
sivakd
Posts: 217
Joined: Fri Jul 17, 2009 9:37 am
Location: California, USA
Contact:

Re: Problem 011

Post by sivakd »

The problem text says "four adjacent numbers in any direction (up, down, left, right, or diagonally)"
Image
puzzle is a euphemism for lack of clarity
slindeneau
Posts: 4
Joined: Thu Jun 16, 2011 12:34 am

Re: Problem 011

Post by slindeneau »

And I interpreted that as meaning the squares are adjacent if they are up, down, left, right or diagonally of their neighbor. As opposed to only being adjacent if they are up, down, left or right for instance.

Compare it to say, 'four adjacent numbers in any one direction (up,down, left, right or diagonally)' or even better, 'four adjacent numbers in any straight line (up,down,left, right or diagonally'.
zoeyang
Posts: 1
Joined: Sat Jun 18, 2011 7:10 am

Re: Problem 011

Post by zoeyang »

This problem is the same as problem8!
We can solve this in four direction!
Cruncher2
Posts: 2
Joined: Tue Apr 05, 2011 3:54 pm

Re: Problem 011

Post by Cruncher2 »

I still don't understand how my answer could possibly be wrong...

i've looked over this 100's of times, and nothing is even close to my original answer, has anyone recently completed this?
elr
Posts: 67
Joined: Thu Apr 09, 2009 9:47 am

Re: Problem 011

Post by elr »

problem 11 is straightforward ,if over 50k people solved it there should be no problem with the problem
Image
Post Reply