Блог пользователя ajaykrmnc

Автор ajaykrmnc, история, 4 года назад, По-английски

Suppose we have given a permutation of length n. Can we find the count of a specific binary string of length n-1. Such that for each permutation p we increment the count of binary string b, where b[i]=='1' if p[i+1]>p[i] else '0' for each i from 0...n-2. For n=5 I have runned the bruteforce code

Code

Getting the output

result
  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
4 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Yes, but it's hard.
1776N - Count Permutations