摘要: D. String D. String You are given a string s. Each pair of numbers l and r that fulfill the condition 1 ≤ l ≤ r ≤ |s|, correspond to a substring of th 阅读全文
posted @ 2018-05-13 18:35 thges 阅读(678) 评论(0) 推荐(0) 编辑
摘要: 单调栈模版: //求l,r内最大矩形面积: //h[i]:[L[i],R[i]) 左开右闭,h[i]为区间的最小值 //L[i]:对于h[i]将栈内大于它的数都去掉,这些数不可能做为左端点,若栈为空则L[i]=0,否则L[i]=s.top()+1; //R[i]:对于h[i]将栈内大于它都数都去掉,这些数不可能做为右端点,若栈为空则R[i]=n,否则R[i]=s.top(); #includ... 阅读全文
posted @ 2018-05-13 15:18 thges 阅读(177) 评论(0) 推荐(0) 编辑