How can i get full 100 points in this one? (SMPAIR)

Q:https://www.codechef.com/problems/SMPAIR
P:https://www.codechef.com/viewsolution/28595691
where I am loosing points?

Just find the minimum element and the second least element

You are looping for every possibility which is not required. Just sort the list and print sum of the 1st and 2nd element (1-indexed)

What’s wrong with the old thread?

3 Likes

why dont you sort the array and take the first two element sumcode here

1 Like