Issue with pbds ordered set and priority queue

The same correct code using priority queue… i replace the priority queue with pbds ordered Set in descending order so that it remains same! and i did nothing extra. it gives wrong ans. why? i heard c++14 has problem with pbds. but why will it give wrong answer? i didnt change the original logic of the code. just replaced priority q with ordered set pbds :confused: :frowning: