Help Required CSES Distinct Colors

Revision en1, by retr0coderxyz, 2020-06-17 16:28:17

Hello guys,

I was trying to solve Distinct Colors: link.

I did a naive solution which obviously led to TLE.

TLE

I saw various solutions that use BIT. But I cant assimilate why BIT works here, what BIT represents here (for e.g. in case range sum query BIT keeps track of cummulative frequency.)

It would be great if someone tells some trick how to use BIT for various other purposes too.

Thanks!

Tags #cses

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English retr0coderxyz 2020-06-17 16:28:17 1552 Initial revision (published)