No idea why RTE

Revision en1, by ahshafi, 2022-05-24 04:40:49

In 1681C - Double Sort of last Educational , I sorted the vector {0, 1, .... n-1} using the following comparison function

bool comp(int &i, int &j)
{
	return a[i]<=a[j] and b[i]<=b[j];
}

This resulted in RTE. Submission link

Then I used a tuple vector of (a[i], b[i] , i) instead and sorted it with default STL comparator which however gave AC. Submission link Has it something to do with the comparator?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ahshafi 2022-05-24 04:40:49 568 Initial revision (published)