摘要: Description The left figure below shows a complete 3*3 grid made with 2*(3*4) (=24) matchsticks. The lengths of all matchsticks are one. You can find 阅读全文
posted @ 2019-03-31 21:33 进击的黑仔 阅读(448) 评论(0) 推荐(0)
摘要: 描述 输入一个长度为n的整数序列,从中找出一段不超过m的连续子序列,使得整个序列的和最大。 例如 1,-3,5,1,-2,3 当m=4时,S=5+1-2+3=7 当m=2或m=3时,S=5+1=6 输入格式 第一行两个数n,m(n,m<=300000) 第二行有n个数,要求在n个数找到最大子序和 输 阅读全文
posted @ 2019-03-31 20:15 进击的黑仔 阅读(218) 评论(0) 推荐(0)
摘要: Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it o 阅读全文
posted @ 2019-03-31 18:38 进击的黑仔 阅读(297) 评论(0) 推荐(0)
摘要: Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have 阅读全文
posted @ 2019-03-31 17:26 进击的黑仔 阅读(163) 评论(0) 推荐(0)
摘要: Problem Description Sample Input 8 I 2 I -1 I 1 Q 3 L D R Q 2 8 I 2 I -1 I 1 Q 3 L D R Q 2 Sample Output 2 3 Hint The following diagram shows the stat 阅读全文
posted @ 2019-03-31 16:17 进击的黑仔 阅读(177) 评论(0) 推荐(0)
摘要: 前缀表达式:op a b 中缀表达式:a op b 后缀表达式 a b op 1、对于计算单独的后缀表达式较为简单,从左到右,遇到数字将其压入栈内,遇到操作符从栈中取出两个数进行相应操作,结果再次压入栈内。 2、对于前缀表达式的计算和后缀相似,从右到左的顺序,剩下和后缀一致 3、对于中缀表达式,我们 阅读全文
posted @ 2019-03-31 15:44 进击的黑仔 阅读(1329) 评论(0) 推荐(0)