雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年12月2日

摘要: 题意:给你一个建筑物群的轮廓,求该建筑物群最少由几栋楼房组成(楼房是矩形)思路:贪心一看数据范围怎么大,搜索神马的就算了从后往前扫,将符合的都标记掉(注意高度为0的没有楼房)View Code #include<stdio.h>#include<string.h>const int N=50009;struct data{ int x,y;}s[N];bool used[N];int main(){ int n,w; while(scanf("%d%d",&n,&w)!=EOF) { int i,j; for(i=1;i<=n; 阅读全文

posted @ 2011-12-02 15:39 huhuuu 阅读(369) 评论(0) 推荐(0) 编辑