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

×

Help in 2nd problem of lunchtime

Can anyone tell me where this solution for 2nd problem is going wrong? https://www.codechef.com/viewsolution/16374117 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

6★soham1234
1.8k614
accept rate: 22%

edited 26 Nov '17, 08:45

admin's gravatar image

0★admin ♦♦
19.8k350498541


@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.

link

answered 25 Nov '17, 23:59

aayushkapadia's gravatar image

6★aayushkapadia
4456
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? https://www.codechef.com/viewsolution/16374812 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.

link

answered 26 Nov '17, 00:53

dark_pharoah's gravatar image

2★dark_pharoah
1
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. https://www.codechef.com/viewsolution/16377252

link

answered 26 Nov '17, 13:26

akash_321's gravatar image

4★akash_321
765
accept rate: 0%

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:

×550
×98

question asked: 25 Nov '17, 23:48

question was seen: 533 times

last updated: 26 Nov '17, 13:26