This content is archived!For the 2018-2019 school year, we have switched to using the WLMOJ judge for all MCPT related content. This is an archive of our old website and will not be updated.
This is a classic difference array problem. Increase the total brightness by B at A and decrease it by B at A + L.
Since there are a maximum of 10^7 seconds in a show but 10^4 fireworks, we don’t need such a big array that will mainly be empty. We can use coordinate compression to speed up the program and to reduce memory usage. However, both methods pass. Use a map as the difference array.
Read the problem.