ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1126. Magnetic Storms

Different approaches to solve the task
Posted by mberdyshev 28 Feb 2017 04:54
1. Modification of a deque, which allows to find a min element in O(1).
2. Segment tree.
3. Min/max heap (was too slow for me).
4. Sparse table.
5. Sqrt decomposition.
Hope, it helps to understand how to solve this task.

Edited by author 28.02.2017 15:25