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

×

codechef july long contest .

anyone would tell wats wrng in my code .. its exactly the same as that of the editorial !!!!! the link of the solution is http://www.codechef.com/viewsolution/4326802 .. any help is seriously welcomed

asked 14 Jul '14, 19:23

meintoo's gravatar image

5★meintoo
33136
accept rate: 16%

@meintoo:very well higlighted by sanjeev1779, corner cases are very important and every of them must be handled, Happy learning :)

(15 Jul '14, 13:35) ravishanker3★

There is a minor mistake in your code. Read the problem careully, " In case both the dishes have equal scores, this round will be considered as a tie and nothing else will happen.." So, instead of this:

void merge(int b,int c,int a[],int ans[])

{ if(a[b]>a[c]) ans[c]=b; else ans[b]=c; }

Your code should be void merge(int b,int c,int a[],int ans[]) { if(a[b]>a[c]) ans[c]=b; else if(a[b]<a[c]) ans[b]=c; }

link

answered 14 Jul '14, 20:30

sanjeev1779's gravatar image

2★sanjeev1779
3563814
accept rate: 42%

edited 14 Jul '14, 20:32

hmm thnks a lot !!!!!!!!! . i got dat .

link

answered 15 Jul '14, 09:28

meintoo's gravatar image

5★meintoo
33136
accept rate: 16%

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:

×471
×29
×20

question asked: 14 Jul '14, 19:23

question was seen: 767 times

last updated: 15 Jul '14, 13:35