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

who can tell me some hint with 1189
Posted by ACer 1 Aug 2003 08:36
Re: who can tell me some hint with 1189
First, in one solution if you remove the last digit of the longer number, it will be the same as the shorter one. In this case the shorter one is (n div 11).

Now if you force the last digits of both numbers are the same, it can only be (n div 2 mod 10) or (n div 2 mod 10+5). Store this as a suffix, cut the last digit off n, and do all above for the new but smaller n.

I don't know if I have explained it clearly. If you still have questions, please mail maigoakisame@yahoo.com.cn