A combinatorics Help

Revision en1, by _kite, 2020-04-04 10:03:41

An array of n elements is given. In this array, How many intervals [l,r] contain at least two 2 ? How many intervals [l,r] contain at least one 4? How many intervals contain two 2 and one 4 together? Note that, [1,1],[2,2] these intervals are also valid. Each of them contains 1 element.

Size of n is 1e5.

Tags #combinatorics, #help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English _kite 2020-04-04 10:03:41 338 Initial revision (published)