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

Автор Another_alt_account3, история, 5 лет назад, По-английски

Well everyone have solved this problem (number of subarray devisible by K) but how can we do this if we modify it let's suppose now we have to find number of subarrays whose sum is devisible by k in range [L,R] for let's say 1e5 queries? Is it possible to find in 1s time limit?

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

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

No. Of array elements?

»
5 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

I think it can be done, if k is small.