
队列
文章平均质量分 66
Mr_Treeeee
这个作者很懒,什么都没留下…
展开
-
POJ 2823 Sliding Window(单调队列)
Sliding Window Time Limit: 12000MS Memory Limit: 65536K Total Submissions: 61914 Accepted: 17733 Case Time Limit: 5000MS Description An array of size n ≤ 106 i原创 2017-08-10 23:10:01 · 279 阅读 · 0 评论 -
2018 Multi-University Training Contest 3 - Problem A. Ascending Rating (单调队列)
http://acm.hdu.edu.cn/showproblem.php?pid=6319 题意: 太长了。 POINT: 倒着用单调队列求窗口最大值,并且这样队列里的元素个数就是count值。 o(n)扫一遍就可以了。 比赛中也差不多,但是我是顺着扫的,所以用了单调栈o(n)处理了每个元素到最后的最长上升子序列。但是单调队列的窗口长度写成了k,wa到了最后。sad,犯了...原创 2018-07-30 21:49:23 · 292 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第四场) - J Hash Function (并查集)
https://www.nowcoder.com/acm/contest/142/J 题意: 给你一个n,和n个空位。如果你得到一个x,就把x填在x%n这个位子。如果x%n被填了,就到(x+1)%n,反复。 现在给你n个已经被填好的位子。让你求出字典序最小的入座次序。 POINT: 用一个优先队列。如果序列里的x的位子就是x%n,证明这个数是最开始就放好的。加入优先队列。 ...原创 2018-07-30 21:42:44 · 342 阅读 · 0 评论 -
HDU 5695 - Gym Class (拓扑排序+优先队列)
Gym Class Time Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2108 Accepted Submission(s): 803 Problem Description 众所周知,度度熊喜欢各类体育活动。原创 2017-11-27 11:06:53 · 324 阅读 · 0 评论 -
Educational Codeforces Round 14 - D. Swaps in Permutation (优先队列+并差集)
D. Swaps in Permutation time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output You are given a permutation of the原创 2017-11-27 10:42:23 · 295 阅读 · 0 评论 -
Codeforces Round #452 (Div. 2) - E. Segments Removal(链表+优先队列)
E. Segments Removal time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has an array of integers of lengt原创 2017-12-21 23:05:16 · 407 阅读 · 0 评论 -
HDU 5929 Basic Data Structure(双端队列)
Basic Data Structure Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2849 Accepted Submission(s): 628 Problem Description Mr. Fr原创 2017-11-08 23:08:25 · 259 阅读 · 0 评论 -
HDU 3415 Max Sum of Max-K-sub-sequence(单调队列+最大连续子串和)
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8433 Accepted Submission(s): 3095 Problem Description原创 2017-08-14 15:22:34 · 363 阅读 · 0 评论 -
HDU 3530 Subsequence(单调队列)
Subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7230 Accepted Submission(s): 2448 Problem Description There is a seq原创 2017-08-13 22:42:19 · 397 阅读 · 0 评论 -
2018 “百度之星”程序设计大赛 - 初赛(A) - 度度熊学队列 (STL)
http://acm.hdu.edu.cn/showproblem.php?pid=6375 POINT: 用map映射deque防止MLE。 deque有insert和clear操作,方便 deque库函数 #include <iostream> #include <stdio.h> #include <deque> #include ...原创 2018-08-13 10:34:17 · 217 阅读 · 0 评论