In other words I'm searching faster way to get a data from stdin? I'll use this function to fill the data in a priority_queue without using extra definitions of variables :
priority_queue<string> pq;
for (int i = 0; i < np; ++i)
pq.push(function() );
instead of:
priority_queue<string> pq;
for (int i = 0; i < np; ++i)
{
string curr;
cin >> curr;
pq.push(curr);
}