Strange verdict in compare function while sorting

Правка en1, от Hamzqq9, 2018-01-11 13:53:41

I was trying to solve this problem and after coding it I got Runtime Error.

bool cmp(iiii x,iiii y) {

	int bx=x.st.st/KOK;
	int by=y.st.st/KOK;

	if(bx<by) return true;
	if(bx>by) return false;

	if(x.st.nd>y.st.nd) return false; /* this line */

	return true;

}

When I change the line shown in the code above to

if(x.st.nd>=y.st.nd) return false;

by just adding '=' chararacter It got AC.

Strangely when I debug the code before changing it, cmp function was called infinite time.

Is there a any idea why something like this happened?

Note: iiii means

pair < pair<int,int> , pair<int,int> > 

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Hamzqq9 2018-01-11 13:53:41 784 Initial revision (published)