You are not logged in. Please login at www.codechef.com to post your questions!

×

help required in spoj problem KGSS

Can someone please help me with this problem from spoj on segment trees. I am storing maximum and second maximum element at each node of tree but getting wrong answer. Here is my code. Any help is appreciated.:)

This question is marked "community wiki".

asked 19 May '18, 21:09

pavitra_ag's gravatar image

4★pavitra_ag
696
accept rate: 5%

wikified 20 May '18, 14:33


There is a small mistake. The update operation "sets the value of A[i] to x", not to max(A[i], x).

link

answered 20 May '18, 16:23

meooow's gravatar image

6★meooow ♦
7.1k718
accept rate: 48%

Thanks man! Helped a lot :)

(20 May '18, 19:46) pavitra_ag4★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,755
×1,136

question asked: 19 May '18, 21:09

question was seen: 124 times

last updated: 20 May '18, 19:46