Problem 008
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.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
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
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.
Re: Problem 008
Ah sorry about that. I'm using c++ currently.
Problem 08
Hello All,
I am not able to understand problem number 8.
My Understanding:
1) trying to find the 5 consecutive number (having the highest product) within this 1000 digit numbers.
2) say, i select (15) numbers, get it's product, then get(26) number and get it's product.... keep doing this thing till the end and always making a note of the highest number within them.
Am I right?
1) I just loop through the 1000 digits.
2) Get the 5 numbers from the array 1 by 1.
3) Get the product of the these number.
4) Compare the previous highest value with the present one .
....
I am not able to understand problem number 8.
My Understanding:
1) trying to find the 5 consecutive number (having the highest product) within this 1000 digit numbers.
2) say, i select (15) numbers, get it's product, then get(26) number and get it's product.... keep doing this thing till the end and always making a note of the highest number within them.
Am I right?
1) I just loop through the 1000 digits.
2) Get the 5 numbers from the array 1 by 1.
3) Get the product of the these number.
4) Compare the previous highest value with the present one .
....
Re: Problem 08
Well, have you tried that way? What result did you get?
Re: Problem 08
The answer is the product, not the 5 digit string
Ex: If you get that the string 12345 with product 120 has the greatest product, then the answer is 120 and NOT 12345
Ex: If you get that the string 12345 with product 120 has the greatest product, then the answer is 120 and NOT 12345
 rayfil
 Administrator
 Posts: 1400
 Joined: Sun Mar 26, 2006 4:30 am
 Location: Ontario, Canada
 Contact:
Re: Problem 008
@pawanbcd
We realize you are new to this forum. For problems under 100, the number is padded with leading 0's to make it a 3digit number. This makes it easier for archiving and searching. By using this procedure, an answer to your question might already be available in previous posts.
You may also find useful information in the sticky topic entitled "Comments, questions and clarifications about PE problems".
We realize you are new to this forum. For problems under 100, the number is padded with leading 0's to make it a 3digit number. This makes it easier for archiving and searching. By using this procedure, an answer to your question might already be available in previous posts.
You may also find useful information in the sticky topic entitled "Comments, questions and clarifications about PE problems".
When you assume something, you risk being wrong half the time.
Re: Problem 08
Yes I tried this way and i get the answer as "28xx68" ( cannot tell the complete as per website rules ).EdoI wrote:Well, have you tried that way? What result did you get?
It says it is wrong answer.
Re: Problem 08
Yes i got this point and i copied the product of the consecutive five number as my answer, My Answer is "Edited away by moderator" and the consecutive string i get is "Edited away by moderator"?Usuario wrote:The answer is the product, not the 5 digit string
Ex: If you get that the string 12345 with product 120 has the greatest product, then the answer is 120 and NOT 12345
It tells the answer is wrong.
Re: Problem 008
You should probably edit out even those figures, since searching for those partial strings really gives everything away.
Have you tried multiplying the digits you found by hand? I can't see how you possibly got the product you mentioned.
Have you tried multiplying the digits you found by hand? I can't see how you possibly got the product you mentioned.
Re: Problem 008
You do realise that the problem asks for the product of FIVE digits, don't you?
_{Jaap's Puzzle Page}
Re: Problem 008
hello all i started this problem a day ago i think my code should do what the problem asks but i keep getting the wrong answer
also guys what is the maximum size u can use an array with i.e
const int MAX = 50;
int array[MAX] ={};
i am asking because does the size alter calculation accuracy because im using a size of 250 to hold the numbers given in the problem.
also guys what is the maximum size u can use an array with i.e
const int MAX = 50;
int array[MAX] ={};
i am asking because does the size alter calculation accuracy because im using a size of 250 to hold the numbers given in the problem.
Re: Problem 008
Why 250?
How many sets of five consecutive digits have 6digit number?
How many sets of five consecutive digits have 6digit number?
Thanks for reply
Re: Problem 008
i have none that = 6 digit number max is 5.

 Posts: 3
 Joined: Sat Aug 25, 2012 9:28 pm
Problem 08
Dear Geek Friends, I'm new to project euler and I'm so happy to find such a place to tease my mind.
I just want someone to assure my understanding to the problem 08.
The idea behind problem 8 is to divide the whole string into substrings (200 Arrays) , each array is 5 consecutive characters from 0999, then multiply Array's characters after converting each character to integer. Finally find the greatest product...
The Greatest Product is 31752.
I just want someone to assure my understanding to the problem 08.
The idea behind problem 8 is to divide the whole string into substrings (200 Arrays) , each array is 5 consecutive characters from 0999, then multiply Array's characters after converting each character to integer. Finally find the greatest product...
The Greatest Product is 31752.
Re: Problem 08
Please use existing problem threads: viewtopic.php?f=50&t=845
There are more than 200 possible 5digit substrings of a 1000 digit string. 31671 is the second one.
There are more than 200 possible 5digit substrings of a 1000 digit string. 31671 is the second one.
 rayfil
 Administrator
 Posts: 1400
 Joined: Sun Mar 26, 2006 4:30 am
 Location: Ontario, Canada
 Contact:
Re: Problem 008
@mega_unknown :
For your info, problem numbers below 100 are padded with two 0's to make them 3digit numbers.
Also for your info, starting with the first digit of the 1000digit string having an index of 1, the first 5digit substring would be digits 15; the next 5digit substring would be digits 26; and so on. How many 5digit substrings would there be in the 1000digit string???
For your info, problem numbers below 100 are padded with two 0's to make them 3digit numbers.
Also for your info, starting with the first digit of the 1000digit string having an index of 1, the first 5digit substring would be digits 15; the next 5digit substring would be digits 26; and so on. How many 5digit substrings would there be in the 1000digit string???
When you assume something, you risk being wrong half the time.

 Posts: 3
 Joined: Sat Aug 25, 2012 9:28 pm
Re: Problem 008
I feel so stupid through solving this problem...there is no complete explanation for this problem.
I beg the admin to rewrite this problem in humble way...I understood it in many ways and no one is correct.
I beg the admin to rewrite this problem in humble way...I understood it in many ways and no one is correct.
Code: Select all
{snip}
Last edited by rayfil on Sun Aug 26, 2012 4:59 am, edited 1 time in total.
Reason: No code is allowed in this forum.
Reason: No code is allowed in this forum.
 rayfil
 Administrator
 Posts: 1400
 Joined: Sun Mar 26, 2006 4:30 am
 Location: Ontario, Canada
 Contact:
Re: Problem 008
@mega_unknown :
Please read again the big red banner at the top of the page when you make a post.
As for your request to rewrite the problem description, it has already been solved by well over 100,000 persons without any such request. It can be assumed that it is sufficiently clear.
Please read again the big red banner at the top of the page when you make a post.
As for your request to rewrite the problem description, it has already been solved by well over 100,000 persons without any such request. It can be assumed that it is sufficiently clear.
When you assume something, you risk being wrong half the time.

 Posts: 3
 Joined: Sat Aug 25, 2012 9:28 pm
Re: Problem 008
Thanks rayfil , I have solved it couple seconds ago
Re: Problem 008
How did everyone grab the data off the number 008 site? I copied/pasted into idle (python) and I am getting syntax errors in the data also does the same when I grabbed data from source of the page.
Thanks
Thanks
 rayfil
 Administrator
 Posts: 1400
 Joined: Sun Mar 26, 2006 4:30 am
 Location: Ontario, Canada
 Contact:
Re: Problem 008
If you grabbed it from the source page, you would have noticed that each line is terminated by a "<br />" (which is a code for the html page rendering to perform the carriage return/line feed) and would have been copied along with the remainder of the text numbers. You would have to remove those before processing the actual number.
If you grab it from the problem description, you probably get "carriage return/line feed" characters copied along with the numbers. Same as above before processing.
One trick might be to
 copy the latter first into a word processor such as Windows Note Pad,
 remove all the "carriage return/line feed" characters
 turn WordWrap OFF
 and grab only the resulting string of numbers.
If you grab it from the problem description, you probably get "carriage return/line feed" characters copied along with the numbers. Same as above before processing.
One trick might be to
 copy the latter first into a word processor such as Windows Note Pad,
 remove all the "carriage return/line feed" characters
 turn WordWrap OFF
 and grab only the resulting string of numbers.
When you assume something, you risk being wrong half the time.