Page 3 of 4
Re: Problem 011
Posted: Thu Jun 23, 2011 1:15 am
by rayfil
Cruncher2
Send me a PM with your latest answer, where you found it, and a brief description of your algo.
Re: Problem 011
Posted: Thu Jun 23, 2011 11:41 pm
by slindeneau
problem 11 is straightforward ,if over 50k people solved it there should be no problem with the problem
I am not saying that the problem as a whole is not straightforward. What i am saying is that the title of the problem and body of the problem differ.
It would be nice if they said the same thing.
Re: Problem 011
Posted: Fri Jun 24, 2011 9:31 am
by hk
I added the word 'adjacent' to the title.
Problem 11
Posted: Wed Jul 06, 2011 4:13 am
by dracomage94
in problem 11, we have the following grid:
snip
the four bolded numbers give snip = snip, larger than the supposedly "correct" answer
the four numbers clearly are diagonally adjacent to one another, so why is that answer not valid?
Re: Problem 11
Posted: Wed Jul 06, 2011 6:13 am
by Hibernatus34
They're not on the same line.
Now please remove your spoiler from this forum.
Re: Problem 11
Posted: Thu Jul 07, 2011 1:51 am
by rayfil
dracomage94
I realize this is your first post on this forum. Please note that there is a specific area for questions related to existing published problems, i.e. Project Euler Problems which you would find just above the Suggestions and FAQ section you used. For your information, the problem numbers are padded with leading 0's for ease of searching.
This post has thus been merged with its proper topic.
Re: Problem 011
Posted: Wed Aug 31, 2011 4:14 pm
by Inglonias
I did it using an algorithm that I originally developed to check if somebody won a game of Connect Four. The proudest part of my program, though, was that I used the Scanner class (java) to put in the grid of numbers without typing it myself. Oh, that was fun. I typed in one row manually, and I thought "Nope! Nope! Not doing this 19 more times."
Re: Problem 011
Posted: Wed Aug 31, 2011 5:08 pm
by jaap
Inglonias wrote:I did it using an algorithm that I originally developed to check if somebody won a game of Connect Four. The proudest part of my program, though, was that I used the Scanner class (java) to put in the grid of numbers without typing it myself. Oh, that was fun. I typed in one row manually, and I thought "Nope! Nope! Not doing this 19 more times."
There is no need to type it all in. I just copy/pasted them from the Euler page into my text editor, did a search & replace to change spaces to commas and to remove the leading zeroes, and then pasted that into my program code to use as an array initialiser.
Re: Problem 011 Clarification
Posted: Sat Jan 07, 2012 8:57 pm
by Bajinga
Sorry for bringing up such an easy question, but I was worried about this:
Take the first four lines of the matrix:
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91
If going diagonally, would it be safe to say that this would be one of the diagonals?
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91
Re: Problem 011
Posted: Sat Jan 07, 2012 11:25 pm
by TripleM
Nope - it's just a square grid, it doesn't wrap cyclically like that.
Re: Problem 011
Posted: Sat Jan 07, 2012 11:52 pm
by Bajinga
Ah, thank you!
Re: Problem 011
Posted: Sun Jun 17, 2012 12:36 pm
by starcraft.man
The text for this problem really should be more specific. I thought this problem was to solve for four connected adjacent nodes in ANY direction (i.e. not necessarily the same). I built a nice Graph data structure and the algorithms needed to solve that. Now I'm kind of dissapointed that I over complicated it.
Doesn't seem like I'm the first to misread either.
Re: Problem 011
Posted: Sat Dec 15, 2012 9:29 pm
by omars1515
First time poster like the person above, and I also felt I disappointed in the time spent figuring out the ambiguity.
Edit: Problem states numbers are "on the same straight line," but that's on the LINK. Didn't think there was useful information in the link.
Why should we have to go "back" in our browser to see additional information? WHY???
Re: Problem 011
Posted: Thu Dec 20, 2012 2:40 pm
by euler
omars1515 wrote:WHY???
Why the loud why?
Good point, though. I've modified the wording from,
"What is the greatest product of four adjacent numbers in any direction (up, down, left, right, or diagonally) in the 20×20 grid?"
to,
"What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?"
Does that scratch the itch or does it need more?
Re: Problem 011
Posted: Mon Aug 19, 2013 4:53 am
by vkartik
Am I missing something here ? I'm iterating through all the values of the 2-D array and considering each array element as origin I find 4 element rows(left,right), 4 element columns(up,down),four diagonals in each quadrant relative to the origin. I believe I covered possible cases here. I'm getting a value of 64564558. Can someone please provide me with a hint/clarification if i am missing anything ?
Thanks!
P.S. I solved it, I was right all along. Had a wrong index (i1,j1) (i1,j2) (i3,j3) (i4,j4) for diagonal (same repeated wrong index , cropped up from copy pasting from rows code)
Re: Problem 011
Posted: Mon Aug 19, 2013 4:38 pm
by rayfil
@vkartik
Even though it may be your first post in this forum, you should have read that big RED banner before posting. It clearly warns against posting ANY CODE.
Re: Problem 011
Posted: Tue Dec 17, 2013 5:04 pm
by sh42
Hello to you all.
I'm looking forward to the Problem 11, yet I'm still a bit lost.
At the moment the description is as follows:
The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?
Sorry if I'm causing any more confusion on this, but does that mean I have to check all the products of all adjacent numbers in all the possible directions? (Wouldn't pose a problem for me) and check the products against one another?
That's what I'm getting at. Is that correct?
Love the site, love the problems!
Thank you all.
sh42
Re: Problem 011
Posted: Tue Dec 17, 2013 6:44 pm
by TheEvil
If you do that, you will definitely get the green tick.
Re: Problem 011
Posted: Thu Dec 19, 2013 10:01 am
by sh42
TheEvil wrote:If you do that, you will definitely get the green tick.
Got it, thanks

!
Re: Problem 011
Posted: Thu Jan 09, 2014 8:06 pm
by loucat
I've just solved this problem but I still find the description very misleading and I had to read all this thread to actually understand it.
This is the current text:
"The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?"
To me it seems obvious that "in the same direction" is related to the direction of "26 × 63 × 78 × 14", and not at all obvious that we should check all the possible directions...
I would specify this better, saying "horizontal, vertical, 2 diagonal directions" or maybe saying "all directions where the 4 numbers are adjacent and aligned".
just a suggestion
