poj 3667 Hotel
来源:互联网 发布:网络平台金融整顿 编辑:程序博客网 时间:2024/05/11 20:25
http://poj.org/problem?id=3667
题目大意:给定长度n的空序列和m个操作。操作分两种:
1 x:询问长度为x的最左端的空子序列,输出子序列左端点。
2 x l:清空从x开始长度为l的序列(不一定l长度里面都是非空的)。
比较基础的线段树实现的段修改。线段树上每个单元记录当前段中最长的空段max,左端开始最长的空段lmax,右端开始最长的空段rmax。
ACCODE
program pku_3667;
var max,lmax,rmax:array[1..200000] of longint;
//============================================================================
procedure cover(be,en,now:longint);
var mid:longint;
begin
end;
//============================================================================
function find(be,en,now:longint):longint;
var mid:longint;
begin
end;
//============================================================================
begin
end.
- poj 3667 Hotel
- poj 3667 hotel 线段树…
- poj 3667 Hotel(线段树)
- poj 2488
- POJ 2485 Highways
- POJ 3299
- poj 1905
- POJ 2247 Humble Numbers
- POJ 1753 Flip Game
- POJ 1182 食物链
- POJ 3185 The Water Bowls
- POj 2379 ACM Rank Table
- POJ 1018 Communication System
- POJ 1050 To the Max
- POj 1159 Palindrome (dp)
- POJ 3625 Building Roads
- POJ 2945 Find the Clones
- POJ 2413 How many Fibs?
- tyvj 1721 岛屿
- tyvj 1718 GCD and LCM
- vijos 1119 Car的旅行路线
- 2012福建省信息学奥林匹克CCF NOIP…
- poj 2528 Mayor's posters
- poj 3667 Hotel
- noi 2011 智能车比赛
- noi 2011 阿狸的打字机
- noi 2010 海拔
- noi 2009 变换序列
- bzoj 1877: [SDOI2009]晨跑
- poj 2778 DNA Sequence
- poj 1634 Prison rearrangement
- bzoj 1051 [HAOI2006]受欢迎的牛