I just want to use priority queue with pair of integers such that it stores the maximum product of 2 numbers in descending order . How can i use it in C++ .
For Eg : —
2 5
5 10
3 6
will be save in priority queue as
5 10
3 6
2 5
and if a clash happen , then the first element should be prefer .
Also I was solving this problem using priority queue but getting WA at case 30 , strange RUNTIME error for comparison but it passes using vector of pairs . I just found on the net on how to write custom comparison function for priority queue . Is there any other method without using class or struct .