bzoj1062 "noi2008" Candy Rain

Source: Internet
Author: User

Orz ..... God TM number-form combination problem

Test instructions: http://www.lydsy.com/JudgeOnline/problem.php?id=1062

   

inserting segments, deleting segments, querying the number of segments within a range, and moving segments over time

Sol: The segment must not operate, consider turning the line into a point

First obviously because 2*len is a cycle, so T%=2*len

Because the line segment has an initial position of L, consider moving the segment to the l=0 position, representing the segment in time and length

   

When you insert a point, the coordinates of that point are ((t-l*d)%len,r-l)

Delete a point, delete it directly

For a query operation, the T-moment has a line segment with [L,r] such as

   

First draw the image of the t=0, left and right along the X=len symmetry, and then move the T-unit, over the right edge of the fill to the left

.... This strange figure can't handle qaq but it can be parallelogram.

   

It's still more difficult to qaq, but it can be turned into a rectangle by distorting the coordinate system.

The <len point is still t, and the ordinate is T+PI

The >len point is still t, and the ordinate is T﹣PI

   

Well.... Then is the plane dot, delete point, query sub-matrix and qwq with two-dimensional tree array maintenance can

bzoj1062 "noi2008" Candy Rain

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.