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
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada

11333 - Alphametics

Post by sclo »

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.
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog »

Make sure you "cancel" out terms that does not matter.
New poster
Posts: 23
Joined: Mon Oct 16, 2006 2:18 am

Post by slxst »

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?
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio »

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

Post Reply

Return to “Volume 113 (11300-11399)”