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

×

LTIME35 - KSUM

This problem can be solved by using a priority queue.

My solution : https://www.codechef.com/viewsolution/9984949

Idea is keep a pointer from each element to the last element , and decrement the pointer to the previous element if the subbarray sum is popped out.

To do this we can use a priority queue , pop out and print the largest sum and then modify the pointer and push it back to the queue.

asked 30 Apr '16, 23:09

geek_geek's gravatar image

4★geek_geek
43914
accept rate: 16%


Answer is hidden as author is suspended. Click here to view.

answered 30 Apr '16, 23:16

sampatghosh's gravatar image

1★sampatghosh
(suspended)
accept rate: 12%

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:

×86

question asked: 30 Apr '16, 23:09

question was seen: 1,051 times

last updated: 30 Apr '16, 23:16