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 1071. Nikifor 2

Yes, first I ACed the bruteforce algorithm in 0.187 sec, but later I added to it some mathematical hint. Now it works 0.046 sec.
866224 Hard (DHSP) Pascal Accepted 0.14 121 KB
you can have O(s(x)+s(y)) instead of LCS
 s(a) is length of a in one's radix.
Brute Force with 0.046 sec and 960 Memory