我就不讲一些七七八八的东西了,直接上代码
定义:
priority_queue <int, vector <int>, greater<int> > a;
关键代码:
ans = a.top() + w;