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 1427. SMS

Hint for tles
Posted by coolboy19521 6 Jul 2024 13:10
Binary search the optimal value when only latin and spaces. You don't have to iterate through all m. Calculate transition for n in O(1) time. Overall complexity should be something like O(|s|log(m)).