tomnjerry18's blog

By tomnjerry18, history, 3 years ago, In English

Hi guys, I have been learning segment trees from Segment Trees Hackerearth .

I am trying to solve the problem range minimum query problem given in the end the topic. I am getting wrong answer in the second input in which n = 10^5 and number queries are also 10^5.

Can anyone help me to debug the code? Link to my code Online C++ Compiler.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +9 Vote: I do not like it
	int arr[3*n];

Can u change size of segment tree to 4*n and then submit the solution once. It should pass :)