Why such strange behaviour while outputting the difference in sizes of two queues. When i am storing them in a diff variable its showing right answer, while just outputting the difference gives wrong answer.
#include<bits/stdc++.h>
using namespace std;
int main()
{
priority_queue<int , vector<int> , greater<int> > pmin;
priority_queue<int , vector<int> >pmax;
pmin.push(5);
pmin.push(9);
pmin.push(10);
pmax.push(1);
cout << pmax.size() - pmin.size() << endl;
return 0 ;
}