anti11 - bradendubois/competitive-programming GitHub Wiki
Ocean's Anti-11
ID: anti11
Difficulty: 3.2
CPU Time: 1 second
Memory: 1024 MB
Solution
It might be a bit tricky to notice the pattern, but the number of eligible strings is actually the Fibonacci sequence, though the length n actually corresponds to the n+2th number. To meet the time limit though, when implementing a fibonacci function, you'll want to cache results to speed everything up or the recursion will be far too slow.