BAT2 SPOJ

Revision en1, by rhezo, 2016-03-15 09:02:04

How to solve BAT2-SPOJ?

My idea is that you need to find all increasing subsequences from left (1->n), and all increasing subsequences from right (n->1). Since n can be <=100, this will take 2^100 time, which is too slow. How can it be done efficiently? Or am I thinking in the wrong direction?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rhezo 2016-03-15 09:02:04 344 Initial revision (published)