单调队列
尒轩窗
这个作者很懒,什么都没留下…
展开
-
HDU 5289 Assignment
http://acm.hdu.edu.cn/showproblem.php?pid=5289题意:分组方式是连续的数中最大值和最小值的差小于K,有几种分组方式(不一定用n个数)分析:用双向队列进行两边的删除、插入操作,左边的删除操作是不满足小于K的条件就把左边界右移直到满足条件,右边的操作是当是维护最大值是,保证输入的数比前面的数都小,如果前面的数比他小就把他弹出代码:#...原创 2018-07-16 21:10:52 · 174 阅读 · 0 评论 -
Problem A. Ascending Rating
Problem Description Before the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left to right. It can be easily found that the i -th cont...原创 2018-07-30 21:14:13 · 599 阅读 · 0 评论 -
Taotao Picks Apples
http://acm.hdu.edu.cn/showproblem.php?pid=6406 Problem Description There is an apple tree in front of Taotao's house. When autumn comes, n apples on the tree ripen, and Taotao will go to pick...原创 2018-08-15 21:15:42 · 566 阅读 · 0 评论 -
The writing on the wall 【单调栈+模拟】【ACM-ICPC 2018 南京赛区网络预赛】
https://nanti.jisuanke.com/t/30991 262144KFeeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 3030 Yuan).However, his owner CXY thinks that take-away ...原创 2018-09-02 20:44:50 · 335 阅读 · 0 评论 -
F2. Pictures with Kittens (hard version)【dp+单调队列优化】
F2. Pictures with Kittens (hard version)time limit per test2.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputThe only difference between easy and h...原创 2018-11-18 19:46:47 · 520 阅读 · 0 评论