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.
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 011

Post by rayfil »

Cruncher2
Send me a PM with your latest answer, where you found it, and a brief description of your algo.
When you assume something, you risk being wrong half the time.
slindeneau
Posts: 4
Joined: Thu Jun 16, 2011 12:34 am

Re: Problem 011

Post 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.
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 011

Post by hk »

I added the word 'adjacent' to the title.
Image
War ruins the life and health of untold numbers of innocent children.
dracomage94
Posts: 1
Joined: Wed Jul 06, 2011 4:07 am

Problem 11

Post by dracomage94 »

in problem 11, we have the following grid:

snip

the four bolded numbers give snip = snip, larger than the supposedly "correct" answer
Expand
snip
the four numbers clearly are diagonally adjacent to one another, so why is that answer not valid?
Last edited by rayfil on Thu Jul 07, 2011 1:42 am, edited 1 time in total.
Reason: This is an open forum and results nor code for published problems should be posted.
Hibernatus34
Posts: 31
Joined: Mon May 16, 2011 7:03 am

Re: Problem 11

Post by Hibernatus34 »

They're not on the same line.
Now please remove your spoiler from this forum.
Image Joined PE in May 2011
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 11

Post 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.
When you assume something, you risk being wrong half the time.
Inglonias
Posts: 5
Joined: Tue Feb 15, 2011 12:42 pm

Re: Problem 011

Post 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."
User avatar
jaap
Posts: 588
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 011

Post 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.
Bajinga
Posts: 3
Joined: Sun Aug 28, 2011 11:20 pm

Re: Problem 011 Clarification

Post 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
0100001001100101011011100010000001000100011101
0101101110011000110110000101101110

42656E2044756E63616E

Ben Duncan
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 011

Post by TripleM »

Nope - it's just a square grid, it doesn't wrap cyclically like that.
Bajinga
Posts: 3
Joined: Sun Aug 28, 2011 11:20 pm

Re: Problem 011

Post by Bajinga »

Ah, thank you!
0100001001100101011011100010000001000100011101
0101101110011000110110000101101110

42656E2044756E63616E

Ben Duncan
starcraft.man
Posts: 1
Joined: Sun Jun 17, 2012 12:28 pm

Re: Problem 011

Post 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.
omars1515
Posts: 1
Joined: Sat Dec 15, 2012 9:25 pm

Re: Problem 011

Post 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???
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: Problem 011

Post by euler »

omars1515 wrote:WHY???
Why the loud why? :wink:

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?
Image
impudens simia et macrologus profundus fabulae
vkartik
Posts: 1
Joined: Mon Aug 19, 2013 3:54 am

Re: Problem 011

Post 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)
Last edited by vkartik on Mon Aug 19, 2013 8:33 pm, edited 2 times in total.
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 011

Post 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.
When you assume something, you risk being wrong half the time.
sh42
Posts: 2
Joined: Tue Dec 17, 2013 4:58 pm

Re: Problem 011

Post 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
User avatar
TheEvil
Posts: 84
Joined: Sun Nov 13, 2011 10:38 am
Location: Szeged, Hungary

Re: Problem 011

Post by TheEvil »

If you do that, you will definitely get the green tick.
Image
sh42
Posts: 2
Joined: Tue Dec 17, 2013 4:58 pm

Re: Problem 011

Post by sh42 »

TheEvil wrote:If you do that, you will definitely get the green tick.
Got it, thanks :D!
loucat
Posts: 1
Joined: Thu Jan 09, 2014 8:00 pm

Re: Problem 011

Post 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 :)
Post Reply