How can I solve this problem?

Problem link : Contest Page | CodeChef

Without giving you the code solution directly, I’ll give you a few hints instead. You’re going to need to know the STL pair data structure and custom sorting in C++. Make a pair from each element of arrays A and B and write your own sorting function to sort as required.

1 Like