Problem 161

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.
Post Reply
User avatar
sfabriz
Posts: 175
Joined: Thu Apr 06, 2006 12:18 am
Location: London - UK

Problem 161

Post by sfabriz »

Hello,

I'm not quite happy with my solution for p161, expecially after I saw how many brilliant dp solutions other people wrote in the forum. I'm always willing to learn something from people who write solution that are smarter than mine, so I was waiting for a forum post that I could be able to understand but it hasn't come. It seems that everybody has used a custom slightly different method and I'm not very confortable reading neither perl, nor complicated C code and so.
I tried reading and understanding C# and Java (and even C) solutions, but with no luck. Yarin's solution seems very nice, but I don't get it. I studied it and video printed a bunch of passes and I don't understand why it behaves like that. Also I don't know why he chose to set memo to -1 at first and then use the sum+1. I removed those +1 and -1 and it works fine. And also I discovered a couple of redundant checks within the if clauses, but at the end I still don't get how that solution works.
Same with Robert_Gerbicz's one, SmartSchizo's one, setosha's one, christer's ruby one, zeycus's one and Sternburg's one.
I read them all, a lot and a lot, but no lightbulb has come to me...

I was wandering if there is someone of you guys who would like to spend some time explaining me what is the best method to solve this problem. What I do not understand is why it is possible to solve it memoizing just 2 rows and not 3.

So... if anyone of you would like to help me just send me a pm here ok?

Thank you in advance,
sfabriz
Image
User avatar
sfabriz
Posts: 175
Joined: Thu Apr 06, 2006 12:18 am
Location: London - UK

Re: Problem 161

Post by sfabriz »

All right,
with hk's help I got it right as I wanted to.

Cheers guys,
sfabriz
Image
sanya1998
Posts: 1
Joined: Sat Aug 12, 2017 12:11 pm

Re: Problem 161

Post by sanya1998 »

Hello!
Can somebody check the result for 9*3 grid: 3127?
Post Reply