
单调栈
永夜莫明
菜是原罪
展开
-
Largest Submatrix of All 1’s(单调栈)
题目链接:https://cn.vjudge.net/problem/POJ-3494Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements.InputT...原创 2019-04-24 20:09:29 · 341 阅读 · 0 评论 -
Equivalent Prefixes(单调栈)
链接:https://ac.nowcoder.com/acm/contest/881/A来源:牛客网题目描述Two arrays u and v each with m distinct elements are called equivalent if and only if RMQ(u,l,r)=RMQ(v,l,r)RMQ(u,l,r)=RMQ(v,l,r) for all 1≤...原创 2019-07-19 14:27:30 · 284 阅读 · 0 评论 -
Second Large Rectangle(单调栈)
https://ac.nowcoder.com/acm/contest/882/H求第二大全1矩形面积,单调栈(之前写的单调栈已经看不懂了,ε=ε=ε=(#>д<)ノ)注意同一个矩形不要算重了例1 511111答案应该是4,而不是5#include<iostream>#include<cstdio>#include<a...原创 2019-07-21 20:10:24 · 127 阅读 · 0 评论 -
All-one Matrices(单调栈+思维)
链接:https://ac.nowcoder.com/acm/contest/888/A来源:牛客网题目描述Gromah and LZR entered the great tomb, the first thing they see is a matrix of size n×mn\times mn×m, and the elements in the matrix are all...原创 2019-08-12 23:15:02 · 457 阅读 · 0 评论 -
Queue (单调序列+二分)
https://cn.vjudge.net/problem/CodeForces-91BThere arenwalruses standing in a queue in an airport. They are numbered starting from the queue's tail: the1-st walrus stands at the end of the queue a...原创 2019-08-22 20:47:05 · 383 阅读 · 0 评论