......
qsort(N,n,sizeof(int),comp);
qsort(M,n,sizeof(int),comp);
.....
}
....
sort(AB.begin(), AB.end());
sort(CD.begin(), CD.end());
....
Above are two codes for the SUMFOUR problem..my question is that why the first code gets a tle ..while second code runs in time.
The basic structure and program flow is same in both cases.
I posted it in this section as i think its is due to some bad programming practice.
I would also like to add that the first code may give an stack overflow ...so declaration as global will work fine..i have tested that code also ..it also gives a tle.
Thanks
**code was edited after clarification by swarnprakash only significant part was not deleted , Thanks