Codeforces и Polygon могут быть недоступны в период с 6 декабря, 22:00 (МСК) по 7 декабря, 00:00 (МСК) в связи с проведением технических работ. ×

find how many numbers in subsequence a[l]...a[r] equal to K

Правка en4, от ATofighi, 2016-01-26 14:55:24

Hi,

Can anyone help me with this problem?

You are given an array with n integers a1, a2, ..., an , a integer K and m queries.

There are two types of query:

  1. give you two integers l and r and ask you to print how many number of integers al, al + 1, ..., ar which equal to K.

  2. give you three integers l, r and v and ask you to add the value of al, al + 1, ..., ar by v.

You should print the answer of the first queries.

Thanks, Sorry for my bad English!

Теги algorithms, data structures, sqrt-decomposition

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский ATofighi 2016-01-26 14:55:24 9 Tiny change: ' to print number of' -> ' to print how many number of'
en3 Английский ATofighi 2016-01-26 14:45:41 140 (published)
en2 Английский ATofighi 2016-01-26 14:38:20 17 Tiny change: 'tegers $a_i$ , a inte' -> 'tegers $a_1, a_2, ..., a_n$ , a inte'
en1 Английский ATofighi 2016-01-26 14:37:12 449 Initial revision (saved to drafts)