ahshafi's blog

By ahshafi, history, 22 months ago, In English

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?

  • Vote: I like it
  • -11
  • Vote: I do not like it

»
22 months ago, # |
  Vote: I like it +11 Vote: I do not like it
  • »
    »
    22 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    MAN. someone update gcc compiler please