11333 - Alphametics

All about problems in Volume 113. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

11333 - Alphametics

Post by sclo » Sun Nov 04, 2007 8:37 am

I don't know why I keep getting TLE for this problem.
My method is to rearrange the equation so that there are no minus signs.
In the backtracking, I keep a upper and lower bound on the left and right sides, and I only continue if there can be a solution within the bounds.

baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog » Sun Nov 04, 2007 10:34 am

Make sure you "cancel" out terms that does not matter.

slxst
New poster
Posts: 23
Joined: Mon Oct 16, 2006 2:18 am

Post by slxst » Sat Dec 01, 2007 4:29 am

The first time I tried to backtrack but I got discouraged because I supposed that I will never solve in time.

What I had in mind was to:

1- Count the number of characters in all the equation if is more than 10 then do nothing.
2- Backtrack trying to guess numbers from 0 to 9 for every non-replaced-yet character.

Like baodog said I think we could cancel terms before making the calculations.

It will be enough?

User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio » Sat Dec 01, 2007 8:07 am

I think just canceling its not enough. You must to prune somehow.

-----
Rio

Post Reply

Return to “Volume 113 (11300-11399)”