2020年5月4日
摘要: c++实现栈的push、pop、min 在c++中用一个数组和一个变量(记录栈顶位置)来实现栈结构 阅读全文
posted @ 2020-05-04 23:26 My_serendipity 阅读(1601) 评论(0) 推荐(0) 编辑
摘要: 倍增算法 RMQ(区间最值查询) 主要思想就是区间dp出每个点起2的k次方的长度内的极值。运用大区间的极值由小区间得到,同时大区间的答案可以由小区间随意组合得到。比如我们已经预处理1为起点长度为4的答案,和2为起点向后4的答案,我们查询区间1到5的极值就可以比较1 4区间和2 5区间的答案来得到1 阅读全文
posted @ 2020-05-04 11:05 My_serendipity 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Running Median 动态求中位数 Description For this problem, you will write a program that reads in a sequence of 32 bit signed integers. After each odd indexe 阅读全文
posted @ 2020-05-04 10:03 My_serendipity 阅读(201) 评论(0) 推荐(0) 编辑