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 1158. Censored!

Underrated problem
Posted by raggzy 3 Jul 2014 20:40
1. If you read some discussion, you may have found out, that there is `simple` algo solution, which just does A^M, and sums all final states counts (here A - is transition matrix of automaton built by `bad words`)

Yes, it is cool, algorithmic, etc.
But personally I've completely forgotten the 1st year of university, and after reading that I felt little shame, which results in not willing to implement that.

2. DP
This is one of hardest DP I've ever thought about.
It took me for almost 3 weeks of `background-thinking`.
Although, when you came to the function, which is `DP-able` - code looks small, etc.
But still, the function is hard to come to.
Personally, i felt pure happiness after got my DP ACed.
Actually I'm writing this post affected by this happiness :) Like in school :)
Wish u the same when u solve it!

I'd rate it as `one of the hardest problem` in this volume, if there was only DP solution and no automaton analogy.

If someone can invent similar problem, but without automaton solution - would be very cool!