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



Getting runtime error repeatedly..Is it because of memory limit exceeded?? Or an invalid memory access(arrayindex out of bound exception) ??

BTW, the approach I used here is - A segment tree where each node stores an sorted interval. For a query i then join different disjoint intervals and then i perform a binary search over the newly formed interval to get number of elements which are greater than k.

asked 24 Dec '14, 19:09

abeyaar's gravatar image

accept rate: 30%

edited 24 Dec '14, 19:12

can anyone help??

(29 Dec '14, 21:31) abeyaar1★

I think Segment Tree will get TLE for this problems. I try to solve by Fenwick Tree and got AC. I think because of CPU which is used to judge that problem.


answered 29 Dec '14, 22:05

leduongtuananh's gravatar image

accept rate: 16%

It can be solved with Segment tree but fast i/o is required (even faster than scanf/printf).

(29 Dec '14, 22:22) neo1tech9_76★

no fast i/o is required, i have solved with segTree without fast i/o, i used offline programming

(29 Dec '14, 22:23) gvaibhav217★

hmmmm maybe I should have done more constant optimization before using fast i/o :P

(29 Dec '14, 22:32) neo1tech9_76★
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 24 Dec '14, 19:09

question was seen: 1,968 times

last updated: 29 Dec '14, 22:32