Hi, i have to sort two arrays in a specific way.

I have two parallel arrays A[N] and B[N].

Ι have to sort A in descending order. The changes in A should be happened in B at the same time.

If 2 or more items in A is the same, they should be sorted in ascending order with respect to B.

Can I do that sort with STL?

Example:

Start:

A B

1 4

3 8

3 2

End:

A B

3 2

3 8

1 4