Bzoj-2002-bounce projectile Fly Sheep-chunking

Source: Internet
Author: User

Describe

    • Lostmonkey on the ground along a straight line to put n devices, each device set the initial elastic coefficient ki, when the sheep reached the first device, it will bounce Ki step back to the first I+ki device, if there is no i+ki device, the sheep are bounced. The sheep wanted to know that when it started from the device I, it was bounced a few times. In order to make the game more interesting, Lostmonkey can modify the elastic coefficient of an elastic device, and the elastic coefficient is a positive integer at any time.

Analysis
    • The block, maintenance I position of the sheep after several pop-up the Block (f[]), as well as where to fall after the pop-up (arv[]). This will allow you to complete the subject in n√n time.
    • When the query operation is encountered, each ans plus f[i], I transfer to arv[i], until Arv[i]≥n
    • When a modification is encountered, only the f[] array and the arv[] array of the block are maintained.
    • Maintenance without a point of calculation, but from backward forward backward.
    • I practiced the shot and generated the data, and found the error by the PAT.


Bzoj-2002-bounce projectile Fly Sheep-chunking

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.