Dp problem

Revision en1, by sepiosky, 2015-07-08 00:48:37

Hi ;) can you please help me with this problem , I think its an easy dp but i cant solve :

a permutation with numbers [1, n] is called extremal if for each i ( 1 < i < n ) one of this conditions be true :

1 : pi < pi - 1 and pi < pi + 1

2 : pi > pi - 1 and pi > pi + 1

count the number of extremal permutations with size n ( n  ≤  104 ) modulo m

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English sepiosky 2015-07-09 00:24:38 23 (published)
en1 English sepiosky 2015-07-08 00:48:37 414 Initial revision (saved to drafts)