Code n Counter 4.0 Problem

Revision en2, by adarsh000321, 2019-09-07 16:03:42

Hello Codeforces, I am stuck in one of the challenges (link: /predownloaded/32/13/3213a7385d761d920589aa1bd99691815f6dbc9b.png), all i can think of is dp, but i dont know how to implement that and i also think that the given sample test case( not in image) was wrong because possible arrangements for n=3 and p=1 are {1,2,3},{3,2,1},{3,1,2} that is, there are 3 arrangements but sample output was 2 ;

Tags #combinatorics, #dp, #permutation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en7 English adarsh000321 2019-09-07 16:27:19 20
en6 English adarsh000321 2019-09-07 16:26:05 76
en5 English adarsh000321 2019-09-07 16:22:42 113
en4 English adarsh000321 2019-09-07 16:05:05 69 Tiny change: ' was 2 ;\n' -> ' was 2 ;\n\nhttps://codeforces.me/e3771f/Screenshot (44).png\n'
en3 English adarsh000321 2019-09-07 16:04:12 73 Reverted to en1
en2 English adarsh000321 2019-09-07 16:03:42 73
en1 English adarsh000321 2019-09-07 16:02:47 356 Initial revision (published)