
堆与队列
哆啦AC梦
软件工程
展开
-
POJ 2442 Sequence
Description Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear that we may get n ^ m this kind of原创 2015-08-14 11:12:32 · 343 阅读 · 0 评论 -
HDU 5818 Joint Stacks(模拟 || 优先队列 || 左式堆)
题目链接:点击打开链接 题目大意:给定T个操作,A栈和B栈,操作包含三种,一种是push,即向A栈或B栈中加入一个新元素,一种是pop即输出A栈或B栈的栈顶元素,最后一个是merge,即合并两个栈,并保留第一个栈清空第二个栈(即如果输入merge B A为保留B,清空A)。 题目解析:比赛的时候自己想到去模拟一下,时间复杂度肯定没问题,就是调试可能会耗点时间,于是让队友现行上模板用左式堆过掉了原创 2016-08-10 08:26:04 · 437 阅读 · 0 评论