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


Help in 2nd problem of lunchtime

Can anyone tell me where this solution for 2nd problem is going wrong? p.s.- Its my friend's code and he asked me to debug it after contest but i failed too

asked 25 Nov '17, 23:48

soham1234's gravatar image

accept rate: 22%

edited 26 Nov '17, 08:45

admin's gravatar image

0★admin ♦♦

@soham1234. Why are you directly updating on index x%b where you have actually sorted the vector and messed up the data and the actual element may be somewhere else. I may be wrong again. Please verify.


answered 25 Nov '17, 23:59

aayushkapadia's gravatar image

accept rate: 12%

edited 26 Nov '17, 00:14

n=1e5 for a particular testcase

(26 Nov '17, 00:04) soham12346★

@soham1234 Sorry my problem. Updated answer.

(26 Nov '17, 00:15) aayushkapadia6★

@aayushkapadia Can you please explain how to solve L-R queries?

(26 Nov '17, 00:39) ramini2★

Could Someone Please tell me why this particular solution is giving a wrong answer for the same problem? i tried several methods but my answer was never accepted completely.Could Someone tell me the input for which it gives the wrong answer.?? Help of any kind would be highly appreciated.


answered 26 Nov '17, 00:53

dark_pharoah's gravatar image

accept rate: 0%

Your product in num is overflowing. Use long long.

(26 Nov '17, 01:00) avi2244★

Can anyone tell me why my solution is giving wrong answer on subtask #2 but correct answer on subtasks #1 and #3.


answered 26 Nov '17, 13:26

akash_321's gravatar image

accept rate: 0%

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: 25 Nov '17, 23:48

question was seen: 533 times

last updated: 26 Nov '17, 13:26