×

# CSUBQ november challange

 0 https://www.codechef.com/problems/CSUBQ 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 https://ideone.com/Pp9YtZ asked 29 Nov '17, 11:34 19●3 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★

 0 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 3★dahaodl 1●1 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×858
×67
×16

question asked: 29 Nov '17, 11:34

question was seen: 377 times

last updated: 29 Nov '17, 19:55