【BZOJ 4548】小奇的糖果

相关链接

题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4548
神犇题解:http://www.cnblogs.com/lcf-2000/p/6204367.html

解题报告

自己做的时候怎么都只会$O(n^2)$的算法啊……
看来还是我太年轻了 QwQ

我们来枚举是哪一种颜色不在所选集合中
枚举之后问题变成选择一个不含特定颜色的矩形,使其内部的点最多
下面我们来分情况讨论这个问题:

1. 我们所选矩形没有上下边界的限制

这个我们扫一遍,顺便记录一下就可以了

2. 我们所选的矩形有上/下边界的限制

这个东西我们可以用一个水平的扫描线从上往下扫描一遍
途中需要差前驱,后继这个用平衡树就可以了(似乎这一块可以用并查集优化掉$\log$?)

然后这题就做完啦!

202 thoughts to “【BZOJ 4548】小奇的糖果”

  1. I was wondering if you ever thought of changing
    the structure of your website? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or 2 images.
    Maybe you could space it out better?

  2. Hello there! This is kind of off topic but I need some
    advice from an established blog. Is it hard to set up your own blog?
    I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about making my own but I’m not sure where
    to start. Do you have any ideas or suggestions? Cheers

  3. Howdy! This is kind of off topic but I need some guidance from an established
    blog. Is it hard to set up your own blog? I’m not very techincal
    but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to start.

    Do you have any tips or suggestions? Appreciate
    it

  4. Magnificent goods from you, man. I have understand your stuff previous to and you’re just too wonderful.
    I really like what you’ve acquired here, certainly like what you are stating and
    the way in which you say it. You make it enjoyable and you still take care of to
    keep it wise. I cant wait to read much more from you.
    This is really a terrific website.

  5. I loved as much as you’ll receive carried out right
    here. The sketch is attractive, your authored material
    stylish. nonetheless, you command get bought an impatience over that you wish be delivering the following.
    unwell unquestionably come more formerly again as exactly the
    same nearly very often inside case you shield this increase.

  6. Magnificent beat ! I would like to apprentice even as you
    amend your web site, how could i subscribe for a weblog site?
    The account aided me a appropriate deal. I had been a little bit familiar of this your broadcast offered vibrant transparent concept

  7. Hi, i believe that i saw you visited my website thus i came
    to return the prefer?.I’m attempting to in finding things to enhance
    my site!I assume its ok to make use of some of your
    ideas!!

  8. Remarkable issues here. I’m very glad to look your post.
    Thanks a lot and I am taking a look forward
    to contact you. Will you please drop me a mail?

  9. We’re a group of volunteers and starting a new scheme in our community.
    Your web site provided us with valuable info to work on. You have done an impressive job and our entire community will be thankful to you.

  10. Hi excellent blog! Does running a blog similar to this require a lot of work?
    I have very little knowledge of computer programming but I was hoping to start my own blog soon. Anyway, should you have any suggestions or techniques for new blog owners please
    share. I understand this is off topic but I simply wanted
    to ask. Kudos!

  11. I’m not sure why but this site is loading incredibly slow for me.

    Is anyone else having this issue or is it a problem on my end?
    I’ll check back later on and see if the problem still exists.

  12. It is really a great and helpful piece of info.

    I am happy that you shared this helpful
    info with us. Please keep us up to date like this. Thanks for sharing.

  13. Right here is the perfect blog for anybody who would like to find
    out about this topic. You know so much its almost tough to argue with you (not that I really
    will need to…HaHa). You definitely put a new spin on a subject which has been written about for years.

    Great stuff, just excellent!

  14. Hi, Neat post. There is an issue together with your site in web explorer, might test this?
    IE nonetheless is the marketplace leader and a good section of other people
    will pass over your great writing due to this problem.

  15. Hiya, I’m really glad I have found this information. Nowadays bloggers publish just about gossips and web and this is really irritating. A good website with exciting content, that’s what I need. Thank you for keeping this web site, I will be visiting it. Do you do newsletters? Can not find it.

Leave a Reply

Your email address will not be published. Required fields are marked *