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 1414. Astronomical Database

Question
Posted by SKYDOS 19 Jul 2010 20:10
Is it possible to solve this problem using suffix tree? or it will get MLE?
Re: Question
Posted by Baurzhan 19 Jul 2010 21:18
I solved it with std::set. Just use lower_bound() and upper_bound() functions. Applying lower_bound() is quite straightforwardly(yourSetObject.lower_bound(string)),
 but upper_bound() requires additinal
{max_word_len-string.len} 'z' symbols. Read documentation and you will understand why. That's all!
Re: Question
Posted by Andrew Shmig aka SKYDOS 19 Jul 2010 22:38
I am using C# and dont really know if there is something like lower_bound(), thats why I am asking about suffix tree/array :)