python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to push pair from priority queue into a 2D array?
I am doing a leetcode problem, and I am required to return a 2d array of results. But I am using a priority queue for that and am unable to move elements to a 2d array. I am not able to come up with a...

shinzoabey_
Votes: 0
Answers: 1
Why is pair not working with unordered_map?
The following code doesn't compile.
The line with pair is giving the error. Is there some other way to access the data or is this
way correct??
unordered_map<int,int> hm;
unordered_map<int,in...
Kshitij Tripathi
Votes: 0
Answers: 1
How do I sort a vector of pairs by both of the values rather than just the second one?
What I am looking to do is sort a vector of pairs in a way where the first value is lowest to greatest and the second being greatest to lowest and having priority over the first value ordering whilst ...
Shadow
Votes: 0
Answers: 2
C++: Is accessing values in pairs so much more efficient than accessing array elements?
Suppose we have an array of doubles x and an array of indices y, and we want to sort these indices by the respective values in x (so, sort [i in y] by x[i] as key).
We can then create an array of pair...
Lazy
Votes: 0
Answers: 1