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


CSUBQ november challange here the link to the question. so here's what I did.....for each query I calculated for R and then for L and the difference of both is what I got as an answer. for each query, it is taking O(4*n) =~ O(n). but this only fetches me 25 points. here's the link to code

asked 29 Nov '17, 11:34

mohit9999's gravatar image

accept rate: 0%

you said for each query O(n) and there are q queries so, O(qn) which didn't pass! so, what was wrong here?

(29 Nov '17, 13:50) pk3012★

Wow! That sounds fishy. I observed your code. Your solution takes exactly O(n * Q), so forcedly it fetched ya 25 points. Ya gotta read author's solutions in codechef's discussion. Tryna use BIT and heap to solve it again! Good luck to ya.


answered 29 Nov '17, 14:54

dahaodl's gravatar image

accept rate: 0%

edited 29 Nov '17, 19:55

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: 29 Nov '17, 11:34

question was seen: 377 times

last updated: 29 Nov '17, 19:55