随笔分类 -  ACM — 单调栈

摘要:http://www.bnuoj.com/bnuoj/problem_show.php?pid=25659 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 int main()11 {12 int n,cas=1;13 while(~scanf("%d",&n))14 {15 int i;16 stack stk;17 stk.push(-1);18 ... 阅读全文
posted @ 2013-11-04 16:38 crazy_apple 阅读(206) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3415Common SubstringsTime Limit:5000MSMemory Limit:65536KTotal Submissions:5805Accepted:1911DescriptionA substring of a stringTis defined as:T(i,k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|.Given two stringsA,Band one integerK, we defineS, a set of triples (i,j,k):S= {(i,j,k) |k≥K,A(i 阅读全文
posted @ 2013-07-24 19:55 crazy_apple 阅读(394) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3250Bad Hair DayTime Limit:2000MSMemory Limit:65536KTotal Submissions:11473Accepted:3871DescriptionSome of Farmer John'sNcows (1 ≤N≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows 阅读全文
posted @ 2013-07-23 22:23 crazy_apple 阅读(419) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=2559Largest Rectangle in a HistogramTime Limit:1000MSMemory Limit:65536KTotal Submissions:12297Accepted:3974DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different height 阅读全文
posted @ 2013-07-23 19:44 crazy_apple 阅读(1346) 评论(1) 推荐(0)