Help!!! how to solve UVA online judge 10128 — Queue

Правка en1, от abhatter, 2021-02-05 19:25:52

Hello, I am trying to generate all permutations and for each permutation I am checking if the given conditions are satisfied and then counting it as part of the solution. But this approach times out as the time complexity is n*n!

I am not able to understand as to what can be precomputed.

Any help is appreciated.

Click for problem link

Thanks in advance

Теги #dynamic programing

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский abhatter 2021-02-05 19:25:52 530 Initial revision (published)