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

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

i don't know what is wrong with my idea. I tried many times but still wrong answer. can anyone tell me what is wrong?

source : http://www.spoj.com/problems/GSS2/

code: https://paste.ofcode.org/32Kc7W5baENjJqs2ckLYFwq

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

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

I can't see how you handled the idea of removing duplicates. I solved it using a offline approach. Quora has a nice tutorial on it.

It is harder than GSS3, GSS4 and GSS5. Maybe you want to try them first if you are going to solve them all.

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    i also use offline. i sort the queries wrt right position. if any value appear previously I set 0 at the previous position of the segment tree, and insert the value at the current position. then i use GSS1.