salt_n_ice's blog

By salt_n_ice, 4 years ago, In English

Problem :Link I applied the sparse table algorithm here, but I'm somehow getting a runtime error in one of the test cases. Also, I tried to see where is it going wrong, and in the code, the first "here" is printing, and the second "here" after the declaration of the minimum_query array(mq) is not running(for the test case which is giving runtime error). So I guess that the problem should be somewhere there?

Code
  • Vote: I like it
  • -3
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it -16 Vote: I do not like it

Declare your matrix globally

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did it and now the compiler is stuck and I can't type anything. Is there something wrong with my syntax?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Why are you declaring a sparse table of size N^2 ? This surely gets ML.