codechef july long contest .

dishown
july
long

#1

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


#2

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**>a[c])
ans[c]=b;
else
ans**=c;
}

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


#3

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


#4

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