C++动态规划及单调队列的优化—————拥挤的奶牛(挤奶牛Crowded Cows)和弹簧高跷(POGO的牛Pogo-Cow)
题目描述:FJ的n头奶牛(1#include#include#includeusingnamespacestd;structnode{intx,y;}s[50005];intn,m,tail,head,a[50005],tail1,head1,a1[50005],ans,p[50005];boolcmp(nodeq,noder){returnq.x=s[i].y*2)p[i]++;while(he