ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1189. Pairs of Integers

Only some hours to solve it ! I think it's simple problem. Although at the first sight, it's likely hard.
Posted by Phan Hoài Nam (Harvey Nash) 12 Jan 2011 15:27
You can go from last digit to the first (the leftmost digit to the rightmost digit).

For example : 302

Considering 2 : There are some possibilities: 0 + 2, 1 + 1, 2 + 0, 6 + 6, 5 + 7 ... (first operant is of the larger number, second operant is of the smaller number).

Considering 0 : For each possibilities, you try to find out some possibilities that can be combined to produce 0 : 0 + 0...
You can try any combinations to produce 0 if two operants used to produce 2 is equal, if they are different, you only have an only way, it reduce very much calculations).

Considering 3 : The last digit, you can stop here and consider whether you have achieved a solution.