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

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

Let n be an integer. Consider all permutations on integers 1 to n in lexicographic order, and concatenate them into one big sequence p. For example, if n=3, then p=[1,2,3,1,3,2,2,1,3,2,3,1,3,1,2,3,2,1] . You are given n. Find the number of subarrays of p of length n having sum n(n+1)2. Since this number may be large, output it modulo 998244353 problem link

I AM NOT ABLE TO GET THE PART WHICH I HAVE MARKED WITH RECTANGLE. HOW THE FORMULA N!/K! CAME????????????

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