摘要: http://poj.org/problem?id=2828题意:在一个队列里,有人依次向第pos个位置插入,求最后的序列;思路:用线段树存储区间内剩余的没有被占的位置,注意插入的时候要从后向前插入;代码:View Code #include <iostream>#include <cstdio>#include <algorithm>#include <cstdlib>#define nn 200010using namespace std;struct node{ int l; int r; int num;}link[8*nn];int p 阅读全文
posted @ 2012-04-08 10:43 LT-blogs 阅读(168) 评论(0) 推荐(0) 编辑