Problem 424

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
LarryBlake
Posts: 100
Joined: Sat Aug 29, 2009 8:49 pm

Problem 424

Post by LarryBlake »

Two rules questions:

1. Can an answer (across or down) contain duplicate digits?
2. Can an answer (across or down) contain a zero?

I suspect the answers are both no, but please confirm.
Image
AVN
Posts: 13
Joined: Mon Feb 11, 2013 10:00 pm

Re: Problem 424

Post by AVN »

I haven't solved this problem (it's out of my league at the moment), but I have solved lots of Kakuro puzzles.
I can confirm that the answer on both questions is indeed no.
CFB
Posts: 3
Joined: Tue Sep 27, 2011 6:44 pm

Re: Problem 424

Post by CFB »

I am devastated!!! So near to being in the first 100.
I get the correct solution for the first puzzle, and I get the correct sum for puzzles 1 to 10, but my sum for puzzles 1 to 200 is incorrect.
Can anyone give me a hint as to where my error might be? It is not an integer overflow problem.
Thanks
Colin
User avatar
Marcus_Andrews
Administrator
Posts: 1637
Joined: Wed Nov 09, 2011 5:23 pm

Re: Problem 424

Post by Marcus_Andrews »

Ensure that each equation does not contain any repeated digits or zeroes. It's possible to sometimes get the right number (i.e. the A-J identifier) even if these constraints aren't met 100%, but this won't work for all cases.

Other than that, this is an input-file problem -- so it may be something "silly" like your code only parsing 199 instead of 200 puzzles because of a one-off line-reading error, etc.
CFB wrote:I am devastated!!! So near to being in the first 100.
I get the correct solution for the first puzzle, and I get the correct sum for puzzles 1 to 10, but my sum for puzzles 1 to 200 is incorrect.
Can anyone give me a hint as to where my error might be? It is not an integer overflow problem.
Thanks
Colin
kaifeng
Posts: 1
Joined: Sun Apr 28, 2013 10:27 am

Re: Problem 424

Post by kaifeng »

I found more then one solution even for the sample puzzle; is that possible?
Here is one of my solutions. The difference in show in red.
424.png
You do not have the required permissions to view the files attached to this post.
User avatar
TheEvil
Posts: 84
Joined: Sun Nov 13, 2011 10:38 am
Location: Szeged, Hungary

Re: Problem 424

Post by TheEvil »

In the second row you have two 9's. Every row and coloumn must contain pairwise distinct digits, as far as I know.
Image
whakamaru
Posts: 47
Joined: Thu May 06, 2010 11:08 pm

Re: Problem 424

Post by whakamaru »

I can do them in the newspaper, easily, but can I translate that logic into lines of code? Probably not.
User avatar
tim-brown
Posts: 2
Joined: Wed Jan 09, 2013 3:09 pm

Re: Problem 424

Post by tim-brown »

I am finding two (or more) distinct solutions to some puzzles. e.g. line 9 below.

I see no duplicated numbers, and as far as my arithmetic goes, all of the sums add up.
But the two solutions give different contributions to the "sum of the answers ..."

Am I missing a rule here?

(Line 8 has the same problem; but it has (hXX,vXX) combinations, so this is simpler.)

Code: Select all

7,X,(vBB),(vBD),X,X,X,X,(hBB),C,E,(vEE),(vEC),X,X,(hBC),O,O,O,O,X,X,X,(hEF),H,O,A,(vJ),X,X,X,(hBD),O,O,O,(vI),X,X,(hBE),F,O,O,O,X,X,X,X,(hG),O,O

Code: Select all

[8,1,9,0,2,4,5,7,3,6]
X        v(BB=11) v(BD=10) X        X        X      X
h(BB=11) 9        2        v(EE=22) v(EC=29) X      X
h(BC=19) 2        1        7        9        X      X
X        h(EF=24) 7        9        8        v(J=6) X
X        X        h(BD=10) 2        5        3      v(I=3)
X        X        h(BE=12) 4        7        1      0
X        X        X        X        h(G=5)   2      3
=8190245736

[8,1,9,0,2,4,5,7,6,3]
X        v(BB=11) v(BD=10) X        X        X      X
h(BB=11) 9        2        v(EE=22) v(EC=29) X      X
h(BC=19) 2        1        7        9        X      X
X        h(EF=24) 7        9        8        v(J=3) X
X        X        h(BD=10) 2        7        1      v(I=6)
X        X        h(BE=12) 4        5        2      1
X        X        X        X        h(G=5)   0      5
=8190245763
User avatar
Marcus_Andrews
Administrator
Posts: 1637
Joined: Wed Nov 09, 2011 5:23 pm

Re: Problem 424

Post by Marcus_Andrews »

Zeroes are not allowed.
User avatar
tim-brown
Posts: 2
Joined: Wed Jan 09, 2013 3:09 pm

Re: Problem 424

Post by tim-brown »

Marcus Stuhr wrote:Zeroes are not allowed.
Thanks for that. I's not clear on the problem description (IMHO).

Anyhow, here's hoping that it gets me unique answers. :)
LarryBlake
Posts: 100
Joined: Sat Aug 29, 2009 8:49 pm

Re: Problem 424

Post by LarryBlake »

I get xxxxxxxx through 5. Is that correct? For some reason, my answer for 10 is wrong.

EDIT: Found my mistake. Correct answer for 5 is 35673704235.
Image
ludopulles
Posts: 3
Joined: Sat Jan 05, 2019 3:08 pm

Re: Problem 424

Post by ludopulles »

TheEvil wrote: Sun Apr 28, 2013 12:03 pm In the second row you have two 9's. Every row and coloumn must contain pairwise distinct digits, as far as I know.
So can someone confirm that the second puzzle on https://www.conceptispuzzles.com/index. ... kuro/rules actually is not allowed since 1 is used twice in the third column but in different 'blocks'?
ludopulles
Posts: 3
Joined: Sat Jan 05, 2019 3:08 pm

Re: Problem 424

Post by ludopulles »

My error was because I accepted zeros. I have it right now.

You may have the same digits in a row or column, as long as the digits in each block are distinct.
User avatar
yourmaths
Posts: 47
Joined: Mon Aug 25, 2014 11:00 am

Re: Problem 424

Post by yourmaths »

I just finished this problem. I found it a fun and satisfying problem, but there are a lot of things that can (and did) go wrong. The problem page is pretty vague on the rules of kakuro (and multiple people mention in the forum that they found the specs quite confusing), so I'm hoping the following will help future solvers:

For the complete-grid kakuro (right-hand diagram on the problem page), a "block" is a contiguous row of horizontal or vertical squares. Blocks must add to the totals given. Zeros are not allowed in the grid. Within each block, each digit must be different.

However, the same digit can appear in a row or column (e.g. 1 appears twice in the fourth column of the example on the problem page), so long as it doesn't appear in the same block.

Finally, this is not a rule of kakuro, but, according to my calculations, each of the 200 puzzle strings has a unique solution, so if you're getting more than one solution, your algorithm is doing something wrong. Obviously each puzzle string will have a unique letter-digit mapping so that the final answer is well defined, but for the correct letter-digit mapping, there is a unique complete-grid solution as well.

Hope that helps.
level = lambda number_solved: number_solved // 25
Image
Post Reply