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

Автор rakkoon69, история, 15 месяцев назад, По-английски

Can someone please explain to me why this 195043061 gives WA on test 7 while 195042850 got AC. The only difference is the first submission used Map while the second one used Set. Thanks in advance!

Полный текст и комментарии »

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

Автор rakkoon69, история, 23 месяца назад, По-английски

Given an array of n integers equal to zero. There are 3 type of queries:

  1. Increase all elements from l to r by 1
  2. Decrease all elements from l to r by 1
  3. Count the number of zeros from l to r

Is there an efficient way to solve this problem in O(N log N), O(N sqrt(N)) or at least O(N log2 N)? Thank you in advance!

I've found a O(N log N) solution which I've implemented in 258E - Little Elephant and Tree, my submission: 226468052 (The STree namespace)

Полный текст и комментарии »

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