A counting problem

Revision en1, by Sammmmmmm, 2024-05-15 15:38:42

Given an array of n integers. In 1 operation you can swap 2 adjacent elements a[i] and a[i + 1] if and only if a[i] + a[i + 1] <=

k. Count the number of possible arrays that can be created using a series of operations (possibly none). Two arrays a and b are

considered different if there exists an index i so that a[i] != b[i]

N <= 1e5

K <= 1e9

Ai <= 1e9

Thanks!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sammmmmmm 2024-05-15 15:38:42 403 Initial revision (published)